Sync from SUSE:SLFO:Main python-hatch_vcs revision 45236c46fbdef77f533c767afe8a1ebc

This commit is contained in:
Adrian Schröter 2024-05-03 20:57:29 +02:00
commit cd0e14b1b9
7 changed files with 212 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

4
_service Normal file
View File

@ -0,0 +1,4 @@
<services>
<service name="download_files" mode="disabled">
</service>
</services>

BIN
hatch_vcs-0.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

65
python-hatch_vcs.changes Normal file
View File

@ -0,0 +1,65 @@
-------------------------------------------------------------------
Wed May 17 09:12:25 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add setuptools7x-tests.patch to fix tests with newer setuptools
-------------------------------------------------------------------
Fri Apr 21 12:26:09 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:41:48 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Mon Feb 27 09:05:31 UTC 2023 - Matej Cepl <mcepl@suse.com>
- The test build branch MUST BR the package itself.
-------------------------------------------------------------------
Tue Feb 21 08:48:31 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Switch to _multibuild to avoid a build cycle with pytest.
-------------------------------------------------------------------
Sat Dec 10 17:00:57 UTC 2022 - Johannes Kastl <kastl@b1-systems.de>
- update to 0.3.0:
* Changed
- Drop support for Python 2
* Added
- Add a metadata hook for injecting VCS metadata
- Bump the minimum supported version of Hatchling
-------------------------------------------------------------------
Wed Dec 7 06:34:23 UTC 2022 - Johannes Kastl <kastl@b1-systems.de>
- update to 0.2.1:
* Fixed:
- Allow root in raw-options
- drop patch fix-tests-setuptools-scm7.patch
-------------------------------------------------------------------
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>
- Cleanup spec file even more
- Fix requirements: prevent setuptools_scm 7 update
- Provide the canonical PyPI name
-------------------------------------------------------------------
Tue Jul 19 14:22:34 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Cleanup the SPEC file.
-------------------------------------------------------------------
Tue Jul 19 09:27:06 UTC 2022 - Johannes Kastl <kastl@b1-systems.de>
- new package python-hatch_vcs

85
python-hatch_vcs.spec Normal file
View File

@ -0,0 +1,85 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-hatch_vcs%{psuffix}
Version: 0.3.0
Release: 0
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
Patch1: https://github.com/ofek/hatch-vcs/commit/47364faf5563df0eaa631ed10383817762c6b547.patch#/setuptools7x-tests.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros >= 20210929
# https://github.com/ofek/hatch-vcs/issues/8
Requires: (python-setuptools_scm >= 6.4.0)
Requires: python-hatchling >= 0.21.0
Provides: python-hatch-vcs = %{version}-%{release}
BuildArch: noarch
# SECTION build
BuildRequires: %{python_module hatchling >= 0.21.0}
BuildRequires: %{python_module pip}
# /SECTION
%if %{with test}
# SECTION test
BuildRequires: %{python_module hatch_vcs = %{version}}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools_scm >= 6.4.0}
BuildRequires: git
# /SECTION
%endif
%python_subpackages
%description
This provides a plugin for Hatch that uses your preferred version control system (like Git) to determine project versions.
%prep
%autosetup -p1 -n hatch_vcs-%{version}
%build
%pyproject_wheel
%install
%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
%pytest tests
%endif
%if %{without test}
%files %{python_files}
%license LICENSE.txt
%doc README.md
%{python_sitelib}/hatch_vcs
%{python_sitelib}/hatch_vcs-%{version}*-info
%endif
%changelog

29
setuptools7x-tests.patch Normal file
View File

@ -0,0 +1,29 @@
From 47364faf5563df0eaa631ed10383817762c6b547 Mon Sep 17 00:00:00 2001
From: Ben Beasley <code@musicinmybrain.net>
Date: Thu, 5 Jan 2023 18:49:54 -0500
Subject: [PATCH] Work with setuptools_scm 7.1 (fix #25) (#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')