diff --git a/.python-hatch-vcs.metadata b/.python-hatch-vcs.metadata new file mode 100644 index 0000000..b65846b --- /dev/null +++ b/.python-hatch-vcs.metadata @@ -0,0 +1 @@ +026b964066b38fd7e823900817fb9ea7af3f8d9b SOURCES/hatch_vcs-0.3.0.tar.gz diff --git a/SOURCES/.gitignore b/SOURCES/.gitignore new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/SOURCES/.gitignore diff --git a/SOURCES/26.patch b/SOURCES/26.patch new file mode 100644 index 0000000..b1cc55a --- /dev/null +++ b/SOURCES/26.patch @@ -0,0 +1,29 @@ +From 2bf0d32f92f6609258f85131b94d0952fc0ec149 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Mon, 19 Dec 2022 20:20:11 -0500 +Subject: [PATCH] Work with setuptools_scm 7.1 (fix #25) + +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') diff --git a/SPECS/python-hatch-vcs.spec b/SPECS/python-hatch-vcs.spec new file mode 100644 index 0000000..1ae2bae --- /dev/null +++ b/SPECS/python-hatch-vcs.spec @@ -0,0 +1,131 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.3.1) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 3; + 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 +%if %{without bootstrap} +%bcond_without tests +%else +%bcond_with tests +%endif + +Name: python-hatch-vcs +Version: 0.3.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} + +BuildArch: noarch + +# Work with setuptools_scm 7.1 (fix #25) +# https://github.com/ofek/hatch-vcs/pull/26 +Patch: %{url}/pull/26.patch + +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros +BuildRequires: python3dist(setuptools-scm) >= 6.4.0 + +Requires: python3dist(setuptools-scm) >= 6.4.0 + +%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} -p1 + + +%generate_buildrequires +%pyproject_buildrequires -R + + +%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} +%doc HISTORY.md +%doc README.md + + +%changelog +* Fri Jan 20 2023 Fedora Release Engineering - 0.3.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Dec 20 2022 Benjamin A. Beasley - 0.3.0-2 +- Work with setuptools_scm 7.1 + +* Sat Dec 10 2022 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 + +* Sat Oct 22 2022 Benjamin A. Beasley - 0.2.0-10 +- Confirm License is SPDX MIT + +* Sun Sep 11 2022 Benjamin A. Beasley - 0.2.0-9 +- Use hatchling’s new “prepare_metadata_…” hook support for BR’s + +* Thu Jul 21 2022 Benjamin A. Beasley - 0.2.0-8 +- Updated setuptools_scm 7 patch again + +* Thu Jul 07 2022 Benjamin A. Beasley - 0.2.0-7 +- Fix extra newline in description + +* Thu Jun 30 2022 Benjamin A. Beasley - 0.2.0-6 +- Updated setuptools_scm 7 patch + +* Thu Jun 30 2022 Benjamin A. Beasley - 0.2.0-5 +- Fix test compatibility with setuptools_scm 7 + +* Mon Jun 13 2022 Python Maint - 0.2.0-4 +- Rebuilt for Python 3.11 + +* 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)