From 21b1a32b80a544be7804c73d3489532de3ef7d16a621ed305351d7d8e82f7230 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 11 Nov 2022 12:05:03 +0000 Subject: [PATCH] - Add fix-tests-setuptools-scm7.patch upstream patch to support setuptools_scm 7 gh#ofek/hatch-vcs#9 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hatch_vcs?expand=0&rev=5 --- fix-tests-setuptools-scm7.patch | 14 ++++++++++++++ python-hatch_vcs.changes | 6 ++++++ python-hatch_vcs.spec | 8 +++++--- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 fix-tests-setuptools-scm7.patch diff --git a/fix-tests-setuptools-scm7.patch b/fix-tests-setuptools-scm7.patch new file mode 100644 index 0000000..fc52335 --- /dev/null +++ b/fix-tests-setuptools-scm7.patch @@ -0,0 +1,14 @@ +diff --git a/tests/test_build.py b/tests/test_build.py +index 2d719a9..6b907ef 100644 +--- a/tests/test_build.py ++++ b/tests/test_build.py +@@ -75,7 +75,8 @@ def test_write(new_project_write): + assert os.path.isfile(version_file) + + lines = read_file(version_file).splitlines() +- assert lines[3] == "version = '1.2.3'" ++ assert lines[3].startswith(('version =', '__version__ =')) ++ assert lines[3].endswith("version = '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/python-hatch_vcs.changes b/python-hatch_vcs.changes index ad44bb3..d2a5701 100644 --- a/python-hatch_vcs.changes +++ b/python-hatch_vcs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/python-hatch_vcs.spec b/python-hatch_vcs.spec index ced92ab..a3fe30e 100644 --- a/python-hatch_vcs.spec +++ b/python-hatch_vcs.spec @@ -25,11 +25,13 @@ 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 +# PATCH-FIX-UPSTREAM fix-tests-setuptools-scm7.patch gh#ofek/hatch-vcs#9 +Patch0: fix-tests-setuptools-scm7.patch BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 Requires: python-hatchling >= 0.21.0 # https://github.com/ofek/hatch-vcs/issues/8 -Requires: (python-setuptools_scm >= 6.4.0 with python-setuptools_scm < 7) +Requires: (python-setuptools_scm >= 6.4.0) Provides: python-hatch-vcs = %{version}-%{info} BuildArch: noarch # SECTION build @@ -37,7 +39,7 @@ BuildRequires: %{python_module hatchling >= 0.21.0} BuildRequires: %{python_module pip} # /SECTION # SECTION test -BuildRequires: %{python_module setuptools_scm >= 6.4.0 with %python-setuptools_scm < 7} +BuildRequires: %{python_module setuptools_scm >= 6.4.0} BuildRequires: %{python_module pytest} BuildRequires: git # /SECTION @@ -47,7 +49,7 @@ BuildRequires: git This provides a plugin for Hatch that uses your preferred version control system (like Git) to determine project versions. %prep -%setup -q -n hatch_vcs-%{version} +%autosetup -p1 -n hatch_vcs-%{version} %build %pyproject_wheel