diff --git a/-0.15.1.tar.gz b/-0.15.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python-django-tastypie.spec b/python-django-tastypie.spec index 8cd65164008432237d9c194928aa3da2658edb21..c991a8ce8bd8eeffece0229bfbdca7bb5c975e04 100644 --- a/python-django-tastypie.spec +++ b/python-django-tastypie.spec @@ -1,22 +1,28 @@ %global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-django-tastypie Version: 0.15.1 Release: 1 Summary: A flexible & capable API layer for Django. License: BSD-3-Clause URL: https://github.com/django-tastypie/django-tastypie -Source0: https://github.com/django-tastypie/django-tastypie/archive/refs/tags/v%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/-//-%{version}.tar.gz BuildArch: noarch +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-devel +BuildRequires: python3-setuptools + %description Creating delicious APIs for Django apps since 2010. %package -n python3-django-tastypie Summary: A flexible & capable API layer for Django. Provides: python-django-tastypie -BuildRequires: python3-devel -BuildRequires: python3-setuptools %description -n python3-django-tastypie Creating delicious APIs for Django apps since 2010. @@ -29,11 +35,29 @@ Creating delicious APIs for Django apps since 2010. %prep %autosetup -n django-tastypie-%{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 @@ -67,6 +91,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 0.15.1-1 +- Update package to version 0.15.1 + * Wed Oct 15 2025 maqi - 0.15.1-1 - Update version to 0.15.1 Django 5.2 support diff --git a/v0.15.1.tar.gz b/v0.15.1.tar.gz deleted file mode 100644 index fe70944e0aa2474a7a05f7b57b89f48ed91bd2f5..0000000000000000000000000000000000000000 Binary files a/v0.15.1.tar.gz and /dev/null differ