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')