%global python3_pkgversion 3.11 Name: python-dotenv Version: 1.0.1 Release: 3.ac8.py3.11%{?dist} 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 Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %description Reads the key/value pair from .env file and adds them to environment variable. %package -n python%{python3_pkgversion}-dotenv Summary: %{summary} Recommends: python3-dotenv+cli %description -n python%{python3_pkgversion}-dotenv Reads the key/value pair from .env file and adds them to environment variable. %prep %autosetup # Get rid of dependency on python-cov, drop --cov... options from pytest # Downstream-only change, based on Fedora's linters policy sed -Ei -e "/^ pytest-cov$/d" \ -e "s/--cov //" \ -e "s/--cov-[[:alnum:]]+(=| +)[^ ]+ //g" \ tox.ini %if 0%{?rhel} # Avoid IPython dependency in tests only needed for optional integration sed -i -e '/ipython/d' requirements.txt tox.ini %endif %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files dotenv %check for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s/(.*)$/\1-%{python3_pkgversion}/"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s/(.*).([1-8]([^.]+)?)$/\1-%{python3_pkgversion}.\2/"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s/(.*).mo$/\1-%{python3_pkgversion}.mo/"<<<"$m"); done %files -n python%{python3_pkgversion}-dotenv -f %{pyproject_files} %doc README.md %pyproject_extras_subpkg -n python3-dotenv cli %{_bindir}/dotenv-%{python3_pkgversion} %changelog * Fri Apr 05 2024 Ding-Yi Chen - 1.0.1-3.ac8.py3.11 - Cut corner packaging