diff --git a/django-rest-framework-0.1.0.tar.gz b/django-rest-framework-0.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9ebb26cc3bfae86655b8d372a1893561bbd75bed Binary files /dev/null and b/django-rest-framework-0.1.0.tar.gz differ diff --git a/django-rest-framework-3.16.0.tar.gz b/django-rest-framework-3.16.0.tar.gz deleted file mode 100644 index 63d5650868ed947a1002d5ae14f8272ddd5d495c..0000000000000000000000000000000000000000 Binary files a/django-rest-framework-3.16.0.tar.gz and /dev/null differ diff --git a/python-django-rest-framework.spec b/python-django-rest-framework.spec index 9db57da40a0ec9a7c92712c97539795d1f85acb1..5d992db42da0405958125f3a46c7670f3a10d031 100644 --- a/python-django-rest-framework.spec +++ b/python-django-rest-framework.spec @@ -1,21 +1,27 @@ %global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-django-rest-framework -Version: 3.16.0 +Version: 0.1.0 Release: 1 Summary: Web APIs for Django. License: BSD-3-Clause URL: https://github.com/encode/django-rest-framework -Source0: https://github.com/encode/django-rest-framework/archive/refs/tags/%{version}.tar.gz#/django-rest-framework-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/d/django-rest-framework/django-rest-framework-%{version}.tar.gz #BuildArch: noarch +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-devel +BuildRequires: python3-setuptools + %description Django REST framework is a powerful and flexible toolkit for building Web APIs. %package -n python3-django-rest-framework Summary: Web APIs for Django. Provides: python-django-rest-framework = %{version}-%{release} -BuildRequires: python3-devel -BuildRequires: python3-setuptools %description -n python3-django-rest-framework Django REST framework is a powerful and flexible toolkit for building Web APIs. @@ -28,11 +34,29 @@ Django REST framework is a powerful and flexible toolkit for building Web APIs. %prep %autosetup -n django-rest-framework-%{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 @@ -66,6 +90,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 0.1.0-1 +- Update package to version 0.1.0 + * Tue Jul 22 2025 liuhan - 3.16.0-1 - Upgrade to version 3.16.0 - Remove Backport-CVE-2024-21520-Fix-potential-XSS-vulnerability.patch