From de6c701046c778319f36f5b40dd33dadf9badf76 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Fri, 22 Apr 2022 16:32:28 +0000 Subject: [PATCH 01/11] Added the README --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2307b34 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# python-hatch-vcs + +The python-hatch-vcs package From 81daa573622d90d797db64376588910815896b19 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 22 Apr 2022 12:38:53 -0400 Subject: [PATCH 02/11] Initial package (close RHBZ#2077832) --- .gitignore | 1 + python-hatch-vcs.spec | 99 +++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 101 insertions(+) create mode 100644 .gitignore create mode 100644 python-hatch-vcs.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..94127e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/hatch_vcs-0.2.0.tar.gz diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec new file mode 100644 index 0000000..36d7b02 --- /dev/null +++ b/python-hatch-vcs.spec @@ -0,0 +1,99 @@ +# Let’s try to build this as early as we can, since it’s a dependency for +# python-userpath. +%bcond_with bootstrap +%if %{without bootstrap} +%bcond_without tests +%else +%bcond_with tests +%endif + +Name: python-hatch-vcs +Version: 0.2.0 +Release: %autorelease +Summary: Hatch plugin for versioning with your preferred VCS + +License: MIT +URL: https://github.com/ofek/hatch-vcs +Source0: %{pypi_source hatch_vcs} + +BuildArch: noarch + +BuildRequires: python3-devel + +# For script in %%generate_buildrequires: +BuildRequires: python3dist(tomli) + +%if %{with tests} +BuildRequires: python3dist(pytest) +BuildRequires: git-core +%endif + +%global common_description %{expand: \ +This provides a plugin for Hatch that uses your preferred version control +system (like Git) to determine project versions.} + +%description +%{common_description} + + +%package -n python3-hatch-vcs +Summary: %{summary} + +%description -n python3-hatch-vcs +%{common_description} + + +%prep +%autosetup -n hatch_vcs-%{version} + + +%generate_buildrequires +# Cannot use %%pyproject_buildrequires -r (the default) with hatchling: +# “ValueError: build backend cannot provide build metadata (incl. runtime +# requirements) before build”. See: https://github.com/ofek/hatch/issues/128 +# +# We work around this by writing the dependencies from pyproject.toml into a +# text file. This may not be necessary in the future; see: +# https://bugzilla.redhat.com/show_bug.cgi?id=2076994 +'%{python3}' <<'EOF' +from tomli import load + +def emit(tomlbase, reqtag, getdeps): + with open(f'{tomlbase}.toml', 'rb') as cfgfile: + deps = getdeps(load(cfgfile)) + with open(f'requirements.{reqtag}.txt', 'w') as reqfile: + reqfile.writelines(f'{dep}\n' for dep in deps) + +emit('pyproject', 'pyproject', lambda cfg: cfg['project']['dependencies']) +EOF +%pyproject_buildrequires -R requirements.pyproject.txt + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files hatch_vcs + + +%check +%if %{with tests} +%pytest +%else +%pyproject_check_import +%endif + + +%files -n python3-hatch-vcs -f %{pyproject_files} +# The license file is installed in an unusual subdirectory. See +# https://bugzilla.redhat.com/show_bug.cgi?id=1985340. +%dir %{python3_sitelib}/hatch_vcs-%{version}.dist-info/license_files +%license %{python3_sitelib}/hatch_vcs-%{version}.dist-info/license_files/LICENSE.txt +%doc HISTORY.md +%doc README.md + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..0338ba2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (hatch_vcs-0.2.0.tar.gz) = 3eb0b04022d4801a982d90a3a0e34e59fcf7dd04c0c2db91c0306b4187ba466ac85ecbb80943a35f4a6a4912bc2ddf2633fab897e8820f5e1ee9d200147b5faf From 8f752060af5314e80e9ed4dd0cbdb45d29fac1c1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 30 Apr 2022 21:43:07 -0400 Subject: [PATCH 03/11] Adjust for pyproject-rpm-macros >= 1.1.0 --- python-hatch-vcs.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 36d7b02..ca208d7 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -19,6 +19,8 @@ Source0: %{pypi_source hatch_vcs} BuildArch: noarch BuildRequires: python3-devel +# RHBZ#1985340 +BuildRequires: pyproject-rpm-macros >= 1.1.0 # For script in %%generate_buildrequires: BuildRequires: python3dist(tomli) @@ -87,10 +89,7 @@ EOF %files -n python3-hatch-vcs -f %{pyproject_files} -# The license file is installed in an unusual subdirectory. See -# https://bugzilla.redhat.com/show_bug.cgi?id=1985340. -%dir %{python3_sitelib}/hatch_vcs-%{version}.dist-info/license_files -%license %{python3_sitelib}/hatch_vcs-%{version}.dist-info/license_files/LICENSE.txt +%license LICENSE.txt %doc HISTORY.md %doc README.md From d76b278d9be81eeec1f341f73cdb9e7239bad2aa Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 6 May 2022 09:11:54 -0400 Subject: [PATCH 04/11] =?UTF-8?q?Use=20wheel-building=20support=20to=20gen?= =?UTF-8?q?erate=20BR=E2=80=99s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-hatch-vcs.spec | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index ca208d7..2716c2f 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -19,11 +19,8 @@ Source0: %{pypi_source hatch_vcs} BuildArch: noarch BuildRequires: python3-devel -# RHBZ#1985340 -BuildRequires: pyproject-rpm-macros >= 1.1.0 - -# For script in %%generate_buildrequires: -BuildRequires: python3dist(tomli) +# RHBZ#1985340, RHBZ#2076994 +BuildRequires: pyproject-rpm-macros >= 1.2.0 %if %{with tests} BuildRequires: python3dist(pytest) @@ -50,25 +47,7 @@ Summary: %{summary} %generate_buildrequires -# Cannot use %%pyproject_buildrequires -r (the default) with hatchling: -# “ValueError: build backend cannot provide build metadata (incl. runtime -# requirements) before build”. See: https://github.com/ofek/hatch/issues/128 -# -# We work around this by writing the dependencies from pyproject.toml into a -# text file. This may not be necessary in the future; see: -# https://bugzilla.redhat.com/show_bug.cgi?id=2076994 -'%{python3}' <<'EOF' -from tomli import load - -def emit(tomlbase, reqtag, getdeps): - with open(f'{tomlbase}.toml', 'rb') as cfgfile: - deps = getdeps(load(cfgfile)) - with open(f'requirements.{reqtag}.txt', 'w') as reqfile: - reqfile.writelines(f'{dep}\n' for dep in deps) - -emit('pyproject', 'pyproject', lambda cfg: cfg['project']['dependencies']) -EOF -%pyproject_buildrequires -R requirements.pyproject.txt +%pyproject_buildrequires -w %build From 27131c5405e177f46804ab527a4841327994d105 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 7 Jul 2022 13:12:19 -0400 Subject: [PATCH 05/11] Fix extra newline in description --- python-hatch-vcs.spec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 2716c2f..63ff4b0 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -27,19 +27,17 @@ BuildRequires: python3dist(pytest) BuildRequires: git-core %endif -%global common_description %{expand: \ +%global common_description %{expand: This provides a plugin for Hatch that uses your preferred version control system (like Git) to determine project versions.} -%description -%{common_description} +%description %{common_description} %package -n python3-hatch-vcs Summary: %{summary} -%description -n python3-hatch-vcs -%{common_description} +%description -n python3-hatch-vcs %{common_description} %prep From 3a3f83c33286d62d0a5418c464da0620a4b80d46 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 22 Oct 2022 09:41:17 -0400 Subject: [PATCH 06/11] Confirm License is SPDX MIT --- python-hatch-vcs.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 63ff4b0..110b7f7 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -12,6 +12,7 @@ Version: 0.2.0 Release: %autorelease Summary: Hatch plugin for versioning with your preferred VCS +# SPDX License: MIT URL: https://github.com/ofek/hatch-vcs Source0: %{pypi_source hatch_vcs} From b49a85b0bebebf796a55128f41c3e84944a8bfa3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 14 Feb 2023 11:22:09 -0500 Subject: [PATCH 07/11] EPEL9: allow python-setuptools_scm 6.0.1 - Skip test_fallback, as upstream does for Python 2.7, due to the downgraded setuptools-scm version. --- python-hatch-vcs.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 110b7f7..42d54be 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -43,6 +43,8 @@ Summary: %{summary} %prep %autosetup -n hatch_vcs-%{version} +# EPEL9-specific: allow python-setuptools_scm 6.0.1 +sed -r -i 's/(setuptools-scm>=6\.)4\.0/\10\.1/' pyproject.toml %generate_buildrequires @@ -60,7 +62,11 @@ Summary: %{summary} %check %if %{with tests} -%pytest +# EPEL9: This test fails with setuptools-scm < 6.4.0. Upstream assumes that +# happens only for Python 2 (and skips the test accordingly), but we have +# allowed setuptools-scm 6.0.1 on Python 3 as well. +k="${k-}${k+ and }not test_fallback" +%pytest -k "${k-}" %else %pyproject_check_import %endif From ef09bd79138bca9b2a933e03b5e60f529374b419 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 14 Feb 2023 11:28:36 -0500 Subject: [PATCH 08/11] Update to 0.2.1 --- .gitignore | 1 + python-hatch-vcs.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 94127e2..dec40bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /hatch_vcs-0.2.0.tar.gz +/hatch_vcs-0.2.1.tar.gz diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 42d54be..e58cf18 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -8,7 +8,7 @@ %endif Name: python-hatch-vcs -Version: 0.2.0 +Version: 0.2.1 Release: %autorelease Summary: Hatch plugin for versioning with your preferred VCS diff --git a/sources b/sources index 0338ba2..8975fd8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (hatch_vcs-0.2.0.tar.gz) = 3eb0b04022d4801a982d90a3a0e34e59fcf7dd04c0c2db91c0306b4187ba466ac85ecbb80943a35f4a6a4912bc2ddf2633fab897e8820f5e1ee9d200147b5faf +SHA512 (hatch_vcs-0.2.1.tar.gz) = 405470f07a8182690c9913fb0bde0d927362e82aa6122e7b2511d4d8ffc2833b32282b1734bf602d394d8a282cc78b209030691be85c2798cac126f3e1f2e147 From 9a9bd2b3475a73396fedfc047de82be8edaaef5a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 11 Sep 2022 09:57:52 -0400 Subject: [PATCH 09/11] =?UTF-8?q?Use=20hatchling=E2=80=99s=20new=20?= =?UTF-8?q?=E2=80=9Cprepare=5Fmetadata=5F=E2=80=A6=E2=80=9D=20hook=20suppo?= =?UTF-8?q?rt=20for=20BR=E2=80=99s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-hatch-vcs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index e58cf18..6df48e9 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -48,7 +48,7 @@ sed -r -i 's/(setuptools-scm>=6\.)4\.0/\10\.1/' pyproject.toml %generate_buildrequires -%pyproject_buildrequires -w +%pyproject_buildrequires %build From 68fcae483658ca4c439141e1456d631b6128580c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 10 Dec 2022 12:21:09 -0500 Subject: [PATCH 10/11] Update to 0.3.0 (close RHBZ#2152320) - We can now rely on pyproject-rpm-macros >= 1.2.0 - The LICENSE.txt file is now handled in pyproject_files - The setuptools_scm 7 patch is now merged upstream --- .gitignore | 1 + python-hatch-vcs.spec | 7 ++----- sources | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index dec40bb..2c911ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /hatch_vcs-0.2.0.tar.gz /hatch_vcs-0.2.1.tar.gz +/hatch_vcs-0.3.0.tar.gz diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 6df48e9..e2fa14b 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -1,5 +1,5 @@ # Let’s try to build this as early as we can, since it’s a dependency for -# python-userpath. +# some important libraries, such as python-platformdirs. %bcond_with bootstrap %if %{without bootstrap} %bcond_without tests @@ -8,7 +8,7 @@ %endif Name: python-hatch-vcs -Version: 0.2.1 +Version: 0.3.0 Release: %autorelease Summary: Hatch plugin for versioning with your preferred VCS @@ -20,8 +20,6 @@ Source0: %{pypi_source hatch_vcs} BuildArch: noarch BuildRequires: python3-devel -# RHBZ#1985340, RHBZ#2076994 -BuildRequires: pyproject-rpm-macros >= 1.2.0 %if %{with tests} BuildRequires: python3dist(pytest) @@ -73,7 +71,6 @@ k="${k-}${k+ and }not test_fallback" %files -n python3-hatch-vcs -f %{pyproject_files} -%license LICENSE.txt %doc HISTORY.md %doc README.md diff --git a/sources b/sources index 8975fd8..7f2b55e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (hatch_vcs-0.2.1.tar.gz) = 405470f07a8182690c9913fb0bde0d927362e82aa6122e7b2511d4d8ffc2833b32282b1734bf602d394d8a282cc78b209030691be85c2798cac126f3e1f2e147 +SHA512 (hatch_vcs-0.3.0.tar.gz) = 06a80e90b45b1316b42845808d04d00d00356f42d32f02d934db0aa9df05efa2f692413709e0dd5465f447829f2f5410110fbbeb826bafdea1f1014e3096e056 From 2891c46bbd943ae5f974c87a63f3eb436ee08837 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Mon, 30 Oct 2023 23:54:22 +0300 Subject: [PATCH 11/11] Remove unnecessary files and fix spec-file --- README.md | 3 --- python-hatch-vcs.spec | 42 +++++++++++++++++++++++++++++++++++++++++- sources | 1 - 3 files changed, 41 insertions(+), 5 deletions(-) delete mode 100644 README.md delete mode 100644 sources diff --git a/README.md b/README.md deleted file mode 100644 index 2307b34..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-hatch-vcs - -The python-hatch-vcs package diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index e2fa14b..ead483f 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -1,3 +1,13 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.3.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 1; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + # Let’s try to build this as early as we can, since it’s a dependency for # some important libraries, such as python-platformdirs. %bcond_with bootstrap @@ -76,4 +86,34 @@ k="${k-}${k+ and }not test_fallback" %changelog -%autochangelog +* Tue Jul 25 2023 Benjamin A. Beasley - 0.3.0-1 +- Update to 0.3.0 (close RHBZ#2152320) +- We can now rely on pyproject-rpm-macros >= 1.2.0 +- The LICENSE.txt file is now handled in pyproject_files +- The setuptools_scm 7 patch is now merged upstream + +* Tue Jul 25 2023 Benjamin A. Beasley - 0.2.1-2 +- Use hatchling’s new “prepare_metadata_…” hook support for BR’s + +* Tue Feb 14 2023 Benjamin A. Beasley - 0.2.1-1 +- Update to 0.2.1 + +* Tue Feb 14 2023 Benjamin A. Beasley - 0.2.0-6 +- EPEL9: allow python-setuptools_scm 6.0.1 +- Skip test_fallback, as upstream does for Python 2.7, due to the + downgraded setuptools-scm version. + +* Tue Feb 14 2023 Benjamin A. Beasley - 0.2.0-5 +- Confirm License is SPDX MIT + +* Sun Sep 11 2022 Benjamin A. Beasley - 0.2.0-4 +- Fix extra newline in description + +* Fri May 06 2022 Benjamin A. Beasley - 0.2.0-3 +- Use wheel-building support to generate BR’s + +* Sun May 01 2022 Benjamin A. Beasley - 0.2.0-2 +- Adjust for pyproject-rpm-macros >= 1.1.0 + +* Fri Apr 22 2022 Benjamin A. Beasley - 0.2.0-1 +- Initial package (close RHBZ#2077832) diff --git a/sources b/sources deleted file mode 100644 index 7f2b55e..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (hatch_vcs-0.3.0.tar.gz) = 06a80e90b45b1316b42845808d04d00d00356f42d32f02d934db0aa9df05efa2f692413709e0dd5465f447829f2f5410110fbbeb826bafdea1f1014e3096e056