- 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
This commit is contained in:
Daniel Garcia 2022-11-11 12:05:03 +00:00 committed by Git OBS Bridge
parent 5d4a160269
commit 21b1a32b80
3 changed files with 25 additions and 3 deletions

View File

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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 11 12:02:43 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- 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 <code@bnavigator.de>

View File

@ -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