diff --git a/defusedxml-0.7.1.tar.gz b/defusedxml-0.7.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fcdcb37a56c5e010560eb7fedeab9323905f78ed Binary files /dev/null and b/defusedxml-0.7.1.tar.gz differ diff --git a/defusedxml-0.8.0rc2.tar.gz b/defusedxml-0.8.0rc2.tar.gz deleted file mode 100644 index 14da1fd9e9e7e5a8c04f1da2edf8a4cc9b164f19..0000000000000000000000000000000000000000 Binary files a/defusedxml-0.8.0rc2.tar.gz and /dev/null differ diff --git a/python-defusedxml.spec b/python-defusedxml.spec index a4b145301ef4f03c8aa76de3d3091789d928408d..c16645b076b886b59abeea7a4cd93bf47a09f804 100644 --- a/python-defusedxml.spec +++ b/python-defusedxml.spec @@ -1,12 +1,20 @@ %global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-defusedxml -Version: 0.8.0rc2 +Version: 0.7.1 Release: 1 Summary: XML bomb protection for Python stdlib modules License: Python-2.0 and MIT URL: https://github.com/tiran/defusedxml -Source0: %{url}/archive/v%{version}/defusedxml-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/d/defusedxml/defusedxml-%{version}.tar.gz BuildArch: noarch +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-devel +BuildRequires: python3-setuptools + %description XML bomb protection for Python stdlib modules. @@ -14,8 +22,6 @@ XML bomb protection for Python stdlib modules. %package -n python3-defusedxml Summary: XML bomb protection for Python stdlib modules Provides: python-defusedxml -BuildRequires: python3-devel -BuildRequires: python3-setuptools %description -n python3-defusedxml XML bomb protection for Python stdlib modules. @@ -30,11 +36,29 @@ XML bomb protection for Python stdlib modules. %prep %autosetup -n defusedxml-%{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 -%py3_build +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" +%pyproject_build %install -%py3_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 if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi @@ -68,6 +92,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 0.7.1-1 +- Update package to version 0.7.1 + * Wed Jun 04 2025 Dongxing Wang - 0.8.0rc2-1 - update package with version 0.8.0rc2