From 18b59494e4463c90b014b95173981187596574e9 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 15 Sep 2023 19:23:20 +0000 Subject: automatic import of python-hatch-vcs --- .gitignore | 1 + Fix-setuptools_scm-7.1.0-test-incompatible.patch | 34 ++++++++++++++++ python-hatch-vcs.spec | 52 ++++++++++++++++++++++++ sources | 1 + 4 files changed, 88 insertions(+) create mode 100644 Fix-setuptools_scm-7.1.0-test-incompatible.patch create mode 100644 python-hatch-vcs.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..ed63947 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/hatch_vcs-0.3.0.tar.gz diff --git a/Fix-setuptools_scm-7.1.0-test-incompatible.patch b/Fix-setuptools_scm-7.1.0-test-incompatible.patch new file mode 100644 index 0000000..bf55b5f --- /dev/null +++ b/Fix-setuptools_scm-7.1.0-test-incompatible.patch @@ -0,0 +1,34 @@ +From dc54e798d83d513c8a3aefee4970c9389497ebf9 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) +Reference: https://github.com/ofek/hatch-vcs/pull/26 + +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') +-- +2.27.0 + diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec new file mode 100644 index 0000000..84c9c47 --- /dev/null +++ b/python-hatch-vcs.spec @@ -0,0 +1,52 @@ +Name: python-hatch-vcs +Version: 0.3.0 +Release: 2 +Summary: Hatch plugin for versioning with your preferred VCS + +License: MIT +URL: https://pypi.org/project/hatch-vcs +Source0: https://files.pythonhosted.org/packages/04/33/b68d68e532392d938472d16a03e4ce0ccd749ea31b42d18f8baa6547cbfd/hatch_vcs-0.3.0.tar.gz +Patch0: Fix-setuptools_scm-7.1.0-test-incompatible.patch +BuildArch: noarch + +BuildRequires: python3-devel python3-pip python3-hatchling +BuildRequires: python3-setuptools_scm python3-pathspec python3-hatch-vcs +BuildRequires: python3dist(pytest) +BuildRequires: git-core + + +%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 + +%build +%pyproject_build + +%install +%pyproject_install hatch_vcs==%{version} + +%check +%{__python3} -m pytest + +%files -n python3-hatch-vcs +%license LICENSE.txt +%doc README.md +%{python3_sitelib}/hatch_vcs +%{python3_sitelib}/hatch_vcs-%{version}*-info + +%changelog +* Fri Sep 01 2023 wulei - 0.3.0-2 +- Fix setuptools_scm 7.1.0 test incompatible + +* Thu Apr 13 2023 caodongxia - 0.3.0-1 +- Package init diff --git a/sources b/sources new file mode 100644 index 0000000..db52d53 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +c2f2cbe6851b7b2969cb4aa24c4b9b2f hatch_vcs-0.3.0.tar.gz -- cgit v1.2.3