Blame tests/python-userpath.spec

6d0900f
Name:           python-userpath
6d0900f
Version:        1.8.0
6d0900f
Release:        1%{?dist}
6d0900f
Summary:        Cross-platform tool for adding locations to the user PATH
6d0900f
License:        MIT
6d0900f
URL:            https://github.com/ofek/userpath
6d0900f
Source:         %{pypi_source userpath}
6d0900f
BuildArch:      noarch
6d0900f
BuildRequires:  python3-devel
6d0900f
6d0900f
%description
6d0900f
This package uses hatchling as build backend.
6d0900f
This package is tested because:
6d0900f
40f6765
 - the prepare_metadata_for_build_wheel hook does not exist,
40f6765
   %%pyproject_buildrequires -w is used
6d0900f
   https://github.com/ofek/hatch/issues/128
6d0900f
 - the licenses are stored in a dist-info subdirectory
6d0900f
   https://bugzilla.redhat.com/1985340
6d0900f
   (as of hatchling 0.22.0, not yet marked as License-File)
6d0900f
6d0900f
6d0900f
%package -n     python3-userpath
6d0900f
Summary:        %{summary}
6d0900f
6d0900f
%description -n python3-userpath
6d0900f
...
6d0900f
6d0900f
6d0900f
%prep
6d0900f
%autosetup -p1 -n userpath-%{version}
6d0900f
sed -Ei '/^(coverage)$/d' requirements-dev.txt
6d0900f
6d0900f
6d0900f
%generate_buildrequires
40f6765
%pyproject_buildrequires requirements-dev.txt -w
6d0900f
6d0900f
40f6765
## %%pyproject_buildrequires -w makes this redundant:
40f6765
#  %%build
40f6765
#  %%pyproject_wheel
6d0900f
6d0900f
6d0900f
%install
6d0900f
%pyproject_install
f392619
%pyproject_save_files -l userpath
6d0900f
6d0900f
6d0900f
%check
6d0900f
%pytest
6d0900f
7600d88
%if 0%{?fedora} || 0%{?rhel} > 9
92ad52e
# Internal check that license file was recognized correctly with hatchling 1.9.0+
92ad52e
grep '^%%license' %{pyproject_files} > tested.license
92ad52e
echo '%%license %{python3_sitelib}/userpath-%{version}.dist-info/licenses/LICENSE.txt' > expected.license
92ad52e
diff tested.license expected.license
92ad52e
%endif
92ad52e
6d0900f
6d0900f
%files -n python3-userpath -f %{pyproject_files}
6d0900f
%{_bindir}/userpath