diff --git a/python-xmltodict.spec b/python-xmltodict.spec index d466cb1a6701db7d8b1121557efe9db707fc4e9f..1dff96b555ae41682ca731287ce7bbed3af79e09 100644 --- a/python-xmltodict.spec +++ b/python-xmltodict.spec @@ -1,23 +1,30 @@ %bcond_with bootstrap +%global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-xmltodict -Version: 1.0.0 +Version: 1.0.2 Release: 1 Summary: Python module that makes working with XML feel like you are working with JSON License: MIT URL: https://github.com/martinblech/xmltodict -Source0: %{pypi_source xmltodict} +Source0: https://files.pythonhosted.org/packages/source/x/xmltodict/xmltodict-%{version}.tar.gz BuildArch: noarch +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-pytest expat-devel +BuildRequires: python3-devel +BuildRequires: python3-setuptools + %description Python module that makes working with XML feel like you are working with JSON %package -n python3-xmltodict Summary: Python module that makes working with XML feel like you are working with JSON -BuildRequires: python3-pytest expat-devel -BuildRequires: python3-devel -BuildRequires: python3-setuptools %{?python_provide:%python_provide python3-xmltodict} %description -n python3-xmltodict @@ -26,11 +33,29 @@ Python module that makes working with XML feel like you are working with JSON %prep %autosetup -n xmltodict-%{version} -p1 +# 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 %check %{__python3} -m pytest tests @@ -42,6 +67,9 @@ Python module that makes working with XML feel like you are working with JSON %changelog +* Mon Dec 01 2025 zhangzeyang0718 - 1.0.2-1 +- Update package to version 1.0.2 + * Wed Sep 17 2025 yaoxin <1024769339@qq.com> - 1.0.0-1 - Update to 1.0.0 for fix CVE-2025-9375 diff --git a/xmltodict-1.0.0.tar.gz b/xmltodict-1.0.0.tar.gz deleted file mode 100644 index e1f7bb863ce5a2cb59a3006ee070ea3f9ce034fa..0000000000000000000000000000000000000000 Binary files a/xmltodict-1.0.0.tar.gz and /dev/null differ diff --git a/xmltodict-1.0.2.tar.gz b/xmltodict-1.0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e30ea734e748f5c8b7fa3020ecad2921b808c6e0 Binary files /dev/null and b/xmltodict-1.0.2.tar.gz differ