diff --git a/-3.1.0.tar.gz b/-3.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/3.1.0.tar.gz b/3.1.0.tar.gz deleted file mode 100644 index 6de9e6a64340b89a87fa3e3a4ba904e7dea3eb8a..0000000000000000000000000000000000000000 Binary files a/3.1.0.tar.gz and /dev/null differ diff --git a/python-time-machine.spec b/python-time-machine.spec index a57f2e337e57fefc526e2088f226937280f29346..83dd18ccc9c9e6ec2ae0efd0236c3e45298a8e4d 100644 --- a/python-time-machine.spec +++ b/python-time-machine.spec @@ -2,13 +2,14 @@ %global pypi_name time-machine %global source_name time-machine +%undefine _python_dist_allow_version_zero Name: python-%{pypi_name} Version: 3.1.0 Release: 1 Summary: Travel through time in your tests. License: MIT URL: https://github.com/adamchainz/time-machine -Source0: https://github.com/adamchainz/time-machine/archive/refs/tags/%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/-//-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -19,6 +20,8 @@ BuildRequires: python3-hatch-vcs BuildRequires: python3-hatchling BuildRequires: python3-virtualenv +BuildRequires: python3-build + %description Travel through time in your tests. @@ -33,10 +36,28 @@ Travel through time in your tests. %prep %autosetup -p1 -n %{source_name}-%{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 %files -n python3-%{pypi_name} @@ -47,6 +68,9 @@ Travel through time in your tests. %{python3_sitearch}/time_machine %changelog +* Mon Dec 01 2025 zhangzeyang0718 - 3.1.0-1 +- Update package to version 3.1.0 + * Mon Nov 24 2025 lixiaoyong - 3.1.0-1 - Update package to version 3.1.0 Optimize patching of uuid module