Convert to %pyproject macros

This commit is contained in:
Miro Hrončok 2022-08-31 13:24:51 +02:00
parent 30ffc93b05
commit 2c8989bc46

View File

@ -1,6 +1,3 @@
%bcond_without wheel
%global wheelname appdirs-%{version}-py2.py3-none-any.whl
Name: python-appdirs
Version: 1.4.4
Release: 7%{?dist}
@ -12,50 +9,48 @@ Source: %{pypi_source appdirs}
BuildArch: noarch
BuildRequires: python3-devel
%description
A small Python module for determining appropriate " + " platform-specific
directories, e.g. a "user data dir".
%package -n python3-appdirs
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if %{with wheel}
BuildRequires: python3-pip
BuildRequires: python3-wheel
%endif
%description -n python3-appdirs
A small Python 3 module for determining appropriate " + " platform-specific
directories, e.g. a "user data dir".
%prep
%autosetup -n appdirs-%{version}
sed -i -e '1{\@^#!/usr/bin/env python@d}' appdirs.py
rm -vrf appdirs.egg-info
%generate_buildrequires
%pyproject_buildrequires
%build
%if %{with wheel}
%py3_build_wheel
%else
%py3_build
%endif
%pyproject_wheel
%install
%if %{with wheel}
%py3_install_wheel %{wheelname}
%else
%py3_install
%endif
%pyproject_install
%pyproject_save_files appdirs
%check
%{__python3} setup.py test
# upstream's tox.ini just wraps this command with no extra deps
# we don't use %%tox here to avoid a dependency loop: tox->platformdirs->appdirs
%{python3} setup.py test
%files -n python3-appdirs
%license LICENSE.txt
%files -n python3-appdirs -f %{pyproject_files}
%doc README.rst CHANGES.rst
%{python3_sitelib}/appdirs*
%{python3_sitelib}/__pycache__/appdirs.*
%changelog
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.4-7