Blame SPECS/python-platformdirs.spec

a2d11d
%bcond_without tests
a2d11d
a2d11d
Name:           python-platformdirs
a2d11d
Version:        4.2.2
a2d11d
Release:        %autorelease
a2d11d
Summary:        A small Python package for determining appropriate platform-specific dirs
a2d11d
License:        MIT
a2d11d
URL:            https://github.com/platformdirs/platformdirs
a2d11d
Source:         %{pypi_source platformdirs}
a2d11d
BuildArch:      noarch
a2d11d
a2d11d
%global common_description %{expand:
a2d11d
When writing desktop application, finding the right location to store user data
a2d11d
and configuration varies per platform.  Even for single-platform apps, there
a2d11d
may by plenty of nuances in figuring out the right location.  This kind of
a2d11d
thing is what the platformdirs package is for.}
a2d11d
a2d11d
a2d11d
%description %{common_description}
a2d11d
a2d11d
a2d11d
%package -n python3-platformdirs
a2d11d
Summary:        %{summary}
a2d11d
BuildRequires:  python3-devel
a2d11d
# RHBZ#1712140, RHBZ#2076994
a2d11d
BuildRequires:  pyproject-rpm-macros >= 1.2.0
a2d11d
a2d11d
a2d11d
%description -n python3-platformdirs %{common_description}
a2d11d
a2d11d
a2d11d
%prep
a2d11d
%autosetup -n platformdirs-%{version}
a2d11d
a2d11d
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
a2d11d
sed -r -i '/^[[:blank:]]*"pytest-cov\b/d' pyproject.toml
a2d11d
sed -r -i '/^[[:blank:]]*"covdefaults\b/d' pyproject.toml
a2d11d
a2d11d
a2d11d
%generate_buildrequires
a2d11d
%pyproject_buildrequires -w %{?with_tests:-x test}
a2d11d
a2d11d
a2d11d
%build
a2d11d
%pyproject_wheel
a2d11d
a2d11d
a2d11d
%install
a2d11d
%pyproject_install
a2d11d
%pyproject_save_files -l platformdirs
a2d11d
a2d11d
a2d11d
%check
a2d11d
%if %{with tests}
a2d11d
# Upstream uses tox, but we don’t use it, to avoid a build dependency loop
a2d11d
# platformdirs <- virtualenv <- tox
a2d11d
%pytest
a2d11d
%else
a2d11d
%pyproject_check_import
a2d11d
%endif
a2d11d
a2d11d
a2d11d
%files -n python3-platformdirs -f %{pyproject_files}
a2d11d
%doc README.rst
a2d11d
a2d11d
a2d11d
%changelog
a2d11d
%autochangelog