From 10e5d5b34780aba34350b28a3d24e62f5b8d91e42c135fb931b2bd582d5ef032 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 28 Jan 2025 04:25:07 +0000 Subject: [PATCH 1/2] - Update to 2.1.0: * [breaking] Drop get_branch_tags function which was deprecated since 1.8.0. * [breaking] version_file option now have precedence over any tags in the current branch. * [breaking] Drop version_config keyword from setup.py, which was deprecated since 1.8.0. * [breaking] Does not allow passing setuptools_git_versioning=False and setuptools_git_versioning=True to config. Always use setuptools_git_versioning={"enabled": True}. * [feature] Test Python 3.13 compatibility * [feature] Test Python 3.12 compatibility * [feature] Remove useless warning if tag_filter, tag_formatter or branch_formatter is a regexp instead of function reference. * [bugfix] Replace outdated toml package with modern tomli. - Rip out _service and all of its gubbins, we can successfully test with the GitHub tarball, so switch to that. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools-git-versioning?expand=0&rev=15 --- .gitattributes | 23 ++++++ .gitignore | 1 + _service | 19 +++++ python-setuptools-git-versioning.changes | 76 +++++++++++++++++++ python-setuptools-git-versioning.spec | 95 ++++++++++++++++++++++++ setuptools-get-versioning-2.1.0.tar.gz | 3 + setuptools-git-versioning-1.13.5.tar.xz | 3 + setuptools-git-versioning.obsinfo | 4 + 8 files changed, 224 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 python-setuptools-git-versioning.changes create mode 100644 python-setuptools-git-versioning.spec create mode 100644 setuptools-get-versioning-2.1.0.tar.gz create mode 100644 setuptools-git-versioning-1.13.5.tar.xz create mode 100644 setuptools-git-versioning.obsinfo diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..f4a643c --- /dev/null +++ b/_service @@ -0,0 +1,19 @@ + + + https://github.com/dolfinus/setuptools-git-versioning.git + git + @PARENT_TAG@ + yes + @PARENT_TAG@ + v(.*) + \1 + + + yes + + + *.tar + xz + + + diff --git a/python-setuptools-git-versioning.changes b/python-setuptools-git-versioning.changes new file mode 100644 index 0000000..7a974b4 --- /dev/null +++ b/python-setuptools-git-versioning.changes @@ -0,0 +1,76 @@ +------------------------------------------------------------------- +Tue Jan 28 04:24:40 UTC 2025 - Steve Kowalik + +- Update to 2.1.0: + * [breaking] Drop get_branch_tags function which was deprecated + since 1.8.0. + * [breaking] version_file option now have precedence over any tags in + the current branch. + * [breaking] Drop version_config keyword from setup.py, which was + deprecated since 1.8.0. + * [breaking] Does not allow passing setuptools_git_versioning=False + and setuptools_git_versioning=True to config. Always use + setuptools_git_versioning={"enabled": True}. + * [feature] Test Python 3.13 compatibility + * [feature] Test Python 3.12 compatibility + * [feature] Remove useless warning if tag_filter, tag_formatter or + branch_formatter is a regexp instead of function reference. + * [bugfix] Replace outdated toml package with modern tomli. +- Rip out _service and all of its gubbins, we can successfully test with + the GitHub tarball, so switch to that. + +------------------------------------------------------------------- +Mon Dec 25 11:20:47 UTC 2023 - Ben Greiner + +- Update to 1.13.5 + * [bugfix] Import setuptools before importing distutils. Thanks + to @tjni + * [bugfix] Move zip-safe option to tool.setuptools section of + pyproject.toml. Thanks to @cclecle +- Accomodate upstream's usage of reruns: some tag + tests fail with commit hashes starting with 0. + +------------------------------------------------------------------- +Fri Jun 9 09:22:01 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Tue Mar 21 13:30:49 UTC 2023 - Martin Liška + +- Run tests in parallel. + +------------------------------------------------------------------- +Fri Mar 3 04:03:58 UTC 2023 - Steve Kowalik + +- Update to 1.13.2: + * Documentation changes only. +- Skip broken test. + +------------------------------------------------------------------- +Mon Feb 20 11:10:37 UTC 2023 - Daniel Garcia + +- Updater to 1.13.1 + * Build and publish sdist package again + * Allow to install package from .tar.gz without --no-build-isolation flag + * Get rid of deprecated package dependency + * Publish development releases to Test PyPI + * Use pypa/gh-action-pypi-publish Github action to publish releases to PyPI + * Remove local part of version because it is not allowed in PyPI +- Update to 1.13.0 + * Make all internal functions private + * Add tag_filter option. Special thanks to @vortechs2000 + * For Python 3.11 use built-in tomllib instead of toml package + * Add documentation about fetching package version in runtime + * Add description for some functions + +------------------------------------------------------------------- +Tue Nov 8 13:52:04 UTC 2022 - Andreas Schwab + +- Simplify dirty version workaround to avoid modifying repo history + +------------------------------------------------------------------- +Mon Oct 31 12:22:11 UTC 2022 - Ben Greiner + +- Initial specfile for v 1.21.1 +- Required to build bokeh 3 diff --git a/python-setuptools-git-versioning.spec b/python-setuptools-git-versioning.spec new file mode 100644 index 0000000..646dd80 --- /dev/null +++ b/python-setuptools-git-versioning.spec @@ -0,0 +1,95 @@ +# +# spec file for package python-setuptools-git-versioning +# +# Copyright (c) 2025 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/ +# + + +%{?sle15_python_module_pythons} +Name: python-setuptools-git-versioning +Version: 2.1.0 +Release: 0 +Summary: Use git repo data for building a version number according PEP-440 +License: MIT +URL: https://setuptools-git-versioning.readthedocs.io +# SourceDist: https://github.com/dolfinus/setuptools-git-versioning +Source: https://github.com/dolfinus/setuptools-git-versioning/archive/refs/tags/v2.1.0.tar.gz#/setuptools-get-versioning-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: git-core +Requires: python-packaging +Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives +Provides: python-setuptools_git_versioning = %{version}-%{release} +BuildArch: noarch +# SECTION test +BuildRequires: %{python_module build} +BuildRequires: %{python_module coverage} +BuildRequires: %{python_module packaging} +BuildRequires: %{python_module pytest-rerunfailures} +BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module toml} +BuildRequires: git-core +# /SECTION +%python_subpackages + +%description +Use git repo data (latest tag, current commit hash, etc) for building a +version number according PEP440. + + - Can be installed & configured through both `setup.py` and :PEP518's `pyproject.toml` + - Does not require to change source code of the project + - Tag-, file-, and callback-based versioning schemas are supported + - Templates for *tag*, *dev* and *dirty* versions are separated + - Templates support a lot of substitutions including git and environment information + +%prep +%autosetup -p1 -n setuptools-git-versioning-%{version} +# Set version +echo "Version: %{version}" > PKG-INFO + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/setuptools-git-versioning +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# cannot test isolated: no wheels for setuptools, wheel, coverage. Modify after wheel build +sed -i '/assert get_version(repo, isolated=True)/d' tests/test_integration/test_config.py +# test tries to get a wheel wheel in isolated build env +donttest="test_substitution_env" +%pytest -k "not ($donttest)" -n auto + +%post +%python_install_alternative setuptools-git-versioning + +%postun +%python_uninstall_alternative setuptools-git-versioning + +%files %{python_files} +%python_alternative %{_bindir}/setuptools-git-versioning +%{python_sitelib}/setuptools_git_versioning.py* +%{python_sitelib}/setuptools_git_versioning-%{version}.dist-info +%pycache_only %{python_sitelib}/__pycache__/setuptools_git_versioning*.pyc + +%changelog diff --git a/setuptools-get-versioning-2.1.0.tar.gz b/setuptools-get-versioning-2.1.0.tar.gz new file mode 100644 index 0000000..c939ead --- /dev/null +++ b/setuptools-get-versioning-2.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36a5c9bd91d75f12faba2c6fd87b1b1807cb9eabeca2ce0951f14ad4f47642e0 +size 44315 diff --git a/setuptools-git-versioning-1.13.5.tar.xz b/setuptools-git-versioning-1.13.5.tar.xz new file mode 100644 index 0000000..346e91a --- /dev/null +++ b/setuptools-git-versioning-1.13.5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27a97d5366a4fd9fa58088b3054ac1ce6f5b6aebe8061f7b4f81f1a17bffc03e +size 313648 diff --git a/setuptools-git-versioning.obsinfo b/setuptools-git-versioning.obsinfo new file mode 100644 index 0000000..1e5160f --- /dev/null +++ b/setuptools-git-versioning.obsinfo @@ -0,0 +1,4 @@ +name: setuptools-git-versioning +version: 1.13.5 +mtime: 1691491394 +commit: 3cd11bcd38f15e2e9b25bee7485e81840f3e16dd From ccd12dcfee06a83624a035fa4b70752e11a132a8d30a19a4e0da7b0ea73ef6a0 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 28 Jan 2025 08:08:37 +0000 Subject: [PATCH 2/2] Correct tarball name OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools-git-versioning?expand=0&rev=16 --- python-setuptools-git-versioning.changes | 2 +- python-setuptools-git-versioning.spec | 2 +- ...oning-2.1.0.tar.gz => setuptools-git-versioning-2.1.0.tar.gz | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename setuptools-get-versioning-2.1.0.tar.gz => setuptools-git-versioning-2.1.0.tar.gz (100%) diff --git a/python-setuptools-git-versioning.changes b/python-setuptools-git-versioning.changes index 7a974b4..7a27379 100644 --- a/python-setuptools-git-versioning.changes +++ b/python-setuptools-git-versioning.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Tue Jan 28 04:24:40 UTC 2025 - Steve Kowalik +Tue Jan 28 08:08:11 UTC 2025 - Steve Kowalik - Update to 2.1.0: * [breaking] Drop get_branch_tags function which was deprecated diff --git a/python-setuptools-git-versioning.spec b/python-setuptools-git-versioning.spec index 646dd80..07a2261 100644 --- a/python-setuptools-git-versioning.spec +++ b/python-setuptools-git-versioning.spec @@ -24,7 +24,7 @@ Summary: Use git repo data for building a version number according PEP-44 License: MIT URL: https://setuptools-git-versioning.readthedocs.io # SourceDist: https://github.com/dolfinus/setuptools-git-versioning -Source: https://github.com/dolfinus/setuptools-git-versioning/archive/refs/tags/v2.1.0.tar.gz#/setuptools-get-versioning-%{version}.tar.gz +Source: https://github.com/dolfinus/setuptools-git-versioning/archive/refs/tags/v2.1.0.tar.gz#/setuptools-git-versioning-%{version}.tar.gz BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} diff --git a/setuptools-get-versioning-2.1.0.tar.gz b/setuptools-git-versioning-2.1.0.tar.gz similarity index 100% rename from setuptools-get-versioning-2.1.0.tar.gz rename to setuptools-git-versioning-2.1.0.tar.gz