diff --git a/python-dotenv.spec b/python-dotenv.spec index f187da4b98b4b00b1a741026fac39017825c0b05..fdeb3f1d50097c46f5614976a76a055697aece3c 100644 --- a/python-dotenv.spec +++ b/python-dotenv.spec @@ -1,14 +1,22 @@ %global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-dotenv -Version: 1.1.1 +Version: 0.9.9 Release: 1 Summary: Read key-value pairs from a .env file and set them as environment variables License: BSD-3-Clause URL: https://github.com/theskumar/python-dotenv -Source0: %{pypi_source python_dotenv} +Source0: https://files.pythonhosted.org/packages/source/p/python_dotenv/python_dotenv-%{version}.tar.gz BuildArch: noarch +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-devel +BuildRequires: python3-setuptools + %description Python-dotenv reads key-value pairs from a .env file and can set them as environment variables. It helps in the development of applications following the 12-factor principles. @@ -16,8 +24,6 @@ Python-dotenv reads key-value pairs from a .env file and can set them as environ Summary: Read key-value pairs from a .env file and set them as environment variables Provides: python-dotenv = %{version}-%{release} Requires: python3-click -BuildRequires: python3-devel -BuildRequires: python3-setuptools %description -n python3-dotenv Python-dotenv reads key-value pairs from a .env file and can set them as environment variables. It helps in the development of applications following the 12-factor principles. @@ -32,11 +38,29 @@ Development documents and examples for python-dotenv. %prep %autosetup -n python_dotenv-%{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 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 @@ -75,6 +99,9 @@ find %{buildroot} -type f -exec file {} ';' | grep "\" | awk -F ':' '{prin %{_docdir}/* %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 0.9.9-1 +- Update package to version 0.9.9 + * Mon Aug 18 2025 zhang_wenyu - 1.1.1-1 - Update to 1.1.1: * Ensure find_dotenv work reliably on python 3.13 diff --git a/python_dotenv-0.9.9.tar.gz b/python_dotenv-0.9.9.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python_dotenv-1.1.1.tar.gz b/python_dotenv-1.1.1.tar.gz deleted file mode 100644 index a441dece498c1859517d775880092556aeb21718..0000000000000000000000000000000000000000 Binary files a/python_dotenv-1.1.1.tar.gz and /dev/null differ