From cd0e14b1b9801b9a053c13381fb20f37952fdb8748cf277da05b0f736f007ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 20:57:29 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-hatch_vcs revision 45236c46fbdef77f533c767afe8a1ebc --- .gitattributes | 23 +++++++++++ _multibuild | 3 ++ _service | 4 ++ hatch_vcs-0.3.0.tar.gz | 3 ++ python-hatch_vcs.changes | 65 ++++++++++++++++++++++++++++++ python-hatch_vcs.spec | 85 ++++++++++++++++++++++++++++++++++++++++ setuptools7x-tests.patch | 29 ++++++++++++++ 7 files changed, 212 insertions(+) create mode 100644 .gitattributes create mode 100644 _multibuild create mode 100644 _service create mode 100644 hatch_vcs-0.3.0.tar.gz create mode 100644 python-hatch_vcs.changes create mode 100644 python-hatch_vcs.spec create mode 100644 setuptools7x-tests.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/_service b/_service new file mode 100644 index 0000000..1bd86b8 --- /dev/null +++ b/_service @@ -0,0 +1,4 @@ + + + + diff --git a/hatch_vcs-0.3.0.tar.gz b/hatch_vcs-0.3.0.tar.gz new file mode 100644 index 0000000..49feed6 --- /dev/null +++ b/hatch_vcs-0.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cec5107cfce482c67f8bc96f18bbc320c9aa0d068180e14ad317bbee5a153fee +size 10172 diff --git a/python-hatch_vcs.changes b/python-hatch_vcs.changes new file mode 100644 index 0000000..24a2d3b --- /dev/null +++ b/python-hatch_vcs.changes @@ -0,0 +1,65 @@ +------------------------------------------------------------------- +Wed May 17 09:12:25 UTC 2023 - Dirk Müller + +- add setuptools7x-tests.patch to fix tests with newer setuptools + +------------------------------------------------------------------- +Fri Apr 21 12:26:09 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:41:48 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Mon Feb 27 09:05:31 UTC 2023 - Matej Cepl + +- The test build branch MUST BR the package itself. + +------------------------------------------------------------------- +Tue Feb 21 08:48:31 UTC 2023 - Matej Cepl + +- Switch to _multibuild to avoid a build cycle with pytest. + +------------------------------------------------------------------- +Sat Dec 10 17:00:57 UTC 2022 - Johannes Kastl + +- update to 0.3.0: + * Changed + - Drop support for Python 2 + * Added + - Add a metadata hook for injecting VCS metadata + - Bump the minimum supported version of Hatchling + +------------------------------------------------------------------- +Wed Dec 7 06:34:23 UTC 2022 - Johannes Kastl + +- update to 0.2.1: + * Fixed: + - Allow root in raw-options +- drop patch fix-tests-setuptools-scm7.patch + +------------------------------------------------------------------- +Fri Nov 11 12:02:43 UTC 2022 - Daniel Garcia + +- Add fix-tests-setuptools-scm7.patch upstream patch to support setuptools_scm + 7 gh#ofek/hatch-vcs#9 + +------------------------------------------------------------------- +Wed Jul 20 11:44:34 UTC 2022 - Ben Greiner + +- Cleanup spec file even more +- Fix requirements: prevent setuptools_scm 7 update +- Provide the canonical PyPI name + +------------------------------------------------------------------- +Tue Jul 19 14:22:34 UTC 2022 - Matej Cepl + +- Cleanup the SPEC file. + +------------------------------------------------------------------- +Tue Jul 19 09:27:06 UTC 2022 - Johannes Kastl + +- new package python-hatch_vcs diff --git a/python-hatch_vcs.spec b/python-hatch_vcs.spec new file mode 100644 index 0000000..75e033c --- /dev/null +++ b/python-hatch_vcs.spec @@ -0,0 +1,85 @@ +# +# spec file +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +%{?sle15_python_module_pythons} +Name: python-hatch_vcs%{psuffix} +Version: 0.3.0 +Release: 0 +Summary: Hatch plugin for versioning with your preferred VCS +License: MIT +URL: https://github.com/ofek/hatch-vcs +Source: https://files.pythonhosted.org/packages/source/h/hatch_vcs/hatch_vcs-%{version}.tar.gz +Patch1: https://github.com/ofek/hatch-vcs/commit/47364faf5563df0eaa631ed10383817762c6b547.patch#/setuptools7x-tests.patch +BuildRequires: fdupes +BuildRequires: python-rpm-macros >= 20210929 +# https://github.com/ofek/hatch-vcs/issues/8 +Requires: (python-setuptools_scm >= 6.4.0) +Requires: python-hatchling >= 0.21.0 +Provides: python-hatch-vcs = %{version}-%{release} +BuildArch: noarch +# SECTION build +BuildRequires: %{python_module hatchling >= 0.21.0} +BuildRequires: %{python_module pip} +# /SECTION +%if %{with test} +# SECTION test +BuildRequires: %{python_module hatch_vcs = %{version}} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools_scm >= 6.4.0} +BuildRequires: git +# /SECTION +%endif +%python_subpackages + +%description +This provides a plugin for Hatch that uses your preferred version control system (like Git) to determine project versions. + +%prep +%autosetup -p1 -n hatch_vcs-%{version} + +%build +%pyproject_wheel + +%install +%if %{without test} +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%check +%if %{with test} +%pytest tests +%endif + +%if %{without test} +%files %{python_files} +%license LICENSE.txt +%doc README.md +%{python_sitelib}/hatch_vcs +%{python_sitelib}/hatch_vcs-%{version}*-info +%endif + +%changelog diff --git a/setuptools7x-tests.patch b/setuptools7x-tests.patch new file mode 100644 index 0000000..7fb238e --- /dev/null +++ b/setuptools7x-tests.patch @@ -0,0 +1,29 @@ +From 47364faf5563df0eaa631ed10383817762c6b547 Mon Sep 17 00:00:00 2001 +From: Ben Beasley +Date: Thu, 5 Jan 2023 18:49:54 -0500 +Subject: [PATCH] Work with setuptools_scm 7.1 (fix #25) (#26) + +Make test_write less brittle (see also #8, #9) so that it works with +_version.py files generated by at least setuptools_scm 7.1, 7.0, and +6.x. +--- + tests/test_build.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/test_build.py b/tests/test_build.py +index 2fde601..7c76343 100644 +--- a/tests/test_build.py ++++ b/tests/test_build.py +@@ -75,8 +75,10 @@ def test_write(new_project_write): + assert os.path.isfile(version_file) + + lines = read_file(version_file).splitlines() +- assert lines[3].startswith(('version =', '__version__ =')) +- assert lines[3].endswith("version = '1.2.3'") ++ version_starts = ('version = ', '__version__ = ') ++ assert any(line.startswith(version_starts) for line in lines) ++ version_line = next(line for line in lines if line.startswith(version_starts)) ++ assert version_line.endswith(" = '1.2.3'") + + + @pytest.mark.skipif(sys.version_info[0] == 2, reason='Depends on fix in 6.4.0 which is Python 3-only')