Sync from SUSE:ALP:Source:Standard:1.0 saltbundlepy-hatch-vcs revision 0c39e5fa98a31612d71c35aebc6bb9b1

This commit is contained in:
Adrian Schröter 2024-07-12 12:19:14 +02:00
commit d3690c4502
7 changed files with 210 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.

View File

@ -0,0 +1,58 @@
-------------------------------------------------------------------
Wed Aug 16 13:58:58 UTC 2023 - Victor Zhestkov <vzhestkov@suse.com>
- Add fix tests with newer setuptools
- Added:
* setuptools7x-tests.patch
-------------------------------------------------------------------
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

View File

@ -0,0 +1,90 @@
#
# spec file for package saltbundlepy-hatch-vcs
#
# 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/
#
%{?!saltbundlepy_module:%define saltbundlepy_module() saltbundlepy-%{**}}
%define pythons saltbundlepy
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: saltbundlepy-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: setuptools7x-tests.patch
BuildRequires: fdupes
BuildRequires: saltbundlepy-rpm-macros
# https://github.com/ofek/hatch-vcs/issues/8
Requires: saltbundlepy-setuptools-scm >= 6.4.0
Requires: saltbundlepy-hatchling >= 0.21.0
BuildArch: noarch
# SECTION build
BuildRequires: %{saltbundlepy_module hatchling >= 0.21.0}
BuildRequires: %{saltbundlepy_module pip}
# /SECTION
%if %{with test}
# SECTION test
%if "%_vendor" == "debbuild"
BuildRequires: %{saltbundlepy_module hatch-vcs >= %{version}-~}
%else
BuildRequires: %{saltbundlepy_module hatch-vcs = %{version}}
%endif
BuildRequires: %{saltbundlepy_module pytest}
BuildRequires: %{saltbundlepy_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')