From aa188172bc748123dfd8618cbfe36599664bc215 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 22 Sep 2023 09:30:09 -0400 Subject: [PATCH] Work with setuptools_scm 8.0 --- 51.patch | 32 ++++++++++++++++++++++++++++++++ python-hatch-vcs.spec | 3 +++ 2 files changed, 35 insertions(+) create mode 100644 51.patch diff --git a/51.patch b/51.patch new file mode 100644 index 0000000..5d7cdf2 --- /dev/null +++ b/51.patch @@ -0,0 +1,32 @@ +From d2d0c13f0887684510c9bce18f3871ee73b63bf8 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 22 Sep 2023 06:56:48 -0400 +Subject: [PATCH] Work with setuptools_scm 8.0 (fix #50) + +Make test_write even less brittle (see also #8, #9, #25) so that it +works with _version.py files generated by at least setuptools_scm 8.0, +7.1, 7.0, and 6.4. + +This is required because setuptools_scm 8.0 added a type-checking +comment at the end of the version line. + +Based on: + +https://src.fedoraproject.org/fork/lbalhar/rpms/python-hatch-vcs/c/ca6e8a95dbe50da64ba98c4e0829ae00ccd8025a +--- + tests/test_build.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_build.py b/tests/test_build.py +index 7c76343..42bd0c4 100644 +--- a/tests/test_build.py ++++ b/tests/test_build.py +@@ -78,7 +78,7 @@ def test_write(new_project_write): + 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'") ++ assert " = '1.2.3'" in version_line + + + @pytest.mark.skipif(sys.version_info[0] == 2, reason='Depends on fix in 6.4.0 which is Python 3-only') diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index 06a8a63..e95ef2b 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -18,6 +18,9 @@ BuildArch: noarch # Work with setuptools_scm 7.1 (fix #25) # https://github.com/ofek/hatch-vcs/pull/26 Patch: %{url}/pull/26.patch +# Work with setuptools_scm 8.0 (fix #50) +# https://github.com/ofek/hatch-vcs/pull/51 +Patch: %{url}/pull/51.patch BuildRequires: python3-devel