diff --git a/python-shtab.spec b/python-shtab.spec index 27e729fd3eb12ac7e7f4e9b954d29d7ae4c8de38..0584579def2f61c66ecf8a410bab095cf34e59ce 100644 --- a/python-shtab.spec +++ b/python-shtab.spec @@ -1,23 +1,29 @@ %global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-shtab -Version: 1.7.2 -Release: 2 +Version: 1.8.0 +Release: 1 Summary: Automagic shell tab completion for Python CLI applications License: Apache-2.0 URL: https://github.com/iterative/shtab -Source0: https://github.com/iterative/shtab/releases/download/v%{version}/shtab-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/s/shtab/shtab-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-pip python3-hatchling python3-hatch-vcs +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-devel +BuildRequires: python3-setuptools python3-setuptools_scm python3-wheel python3-toml + %description Automagic shell tab completion for Python CLI applications %package -n python3-shtab Summary: Automagic shell tab completion for Python CLI applications Provides: python-shtab = %{version}-%{release} -BuildRequires: python3-devel -BuildRequires: python3-setuptools python3-setuptools_scm python3-wheel python3-toml %description -n python3-shtab Automagic shell tab completion for Python CLI applications @@ -30,10 +36,28 @@ Automagic shell tab completion for Python CLI applications %prep %autosetup -n shtab-%{version} +# Fix setuptools_scm version issue +if [ -f pyproject.toml ]; then + sed -i '/^version *=/d' pyproject.toml + sed -i '/^\[project\]/a version = "%{version}"' pyproject.toml + sed -i '/dynamic *= *\[.*version.*\]/d' pyproject.toml + if grep -q '^\[tool\.setuptools_scm\]' pyproject.toml; then + sed -i '/^\[tool\.setuptools_scm\]/,/^\[/ {/^write_to *=/d}' pyproject.toml + sed -i '/^\[tool\.setuptools_scm\]/a fallback_version = "%{version}"' pyproject.toml + fi +fi + %build +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" %pyproject_build %install +export PYTHONDONTWRITEBYTECODE=1 + +# Clean __pycache__ directories and .pyc/.pyo files +find %{buildroot} -name '*.py[co]' -delete +find %{buildroot} -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" %pyproject_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi @@ -51,6 +75,9 @@ if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi %{_docdir}/* %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 1.8.0-1 +- Update package to version 1.8.0 + * Fri Oct 24 2025 Ge Wang - 1.7.2-2 - Remove old 1.7.1 source diff --git a/shtab-1.7.2.tar.gz b/shtab-1.7.2.tar.gz deleted file mode 100644 index 13a2617168373f2596d78f824fd279572b871aba..0000000000000000000000000000000000000000 Binary files a/shtab-1.7.2.tar.gz and /dev/null differ diff --git a/shtab-1.8.0.tar.gz b/shtab-1.8.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6969591f96a18c069affe06cd2e1f1ee0b02a5ca Binary files /dev/null and b/shtab-1.8.0.tar.gz differ