bf165d9
%bcond_without tests
8962508
bf165d9
# The python-diskcache package, used in some of the tests, has been retired.
bf165d9
%bcond_with diskcache
4c6a7f3
227cd6e
Name:           python-fasteners
814c998
Version:        0.19
851f6f8
Release:        %autorelease
0533ce9
Summary:        A python package that provides useful locks
0533ce9
7241e5e
License:        Apache-2.0
0533ce9
URL:            https://github.com/harlowja/fasteners
bf165d9
# We need to use the GitHub archive instead of the PyPI sdist to get tests.
6fbc532
Source:         %{url}/archive/%{version}/fasteners-%{version}.tar.gz
bf165d9
0533ce9
BuildArch:      noarch
0533ce9
bf165d9
BuildRequires:  python3-devel
bf165d9
dea0d38
%global common_description %{expand:
bf165d9
Cross platform locks for threads and processes}
bf165d9
dea0d38
%description %{common_description}
bed0229
bed0229
227cd6e
%package -n python3-fasteners
0533ce9
Summary:        A python package that provides useful locks
0533ce9
16553c9
# The mkdocs-generated HTML documentation is not suitable for packaging; see
16553c9
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
16553c9
#
16553c9
# The Provides/Obsoletes can be removed after F38 reaches end-of-life.
16553c9
Provides:       python-fasteners-doc = %{version}-%{release}
16553c9
Obsoletes:      python-fasteners-doc < 0.18-1
8962508
16553c9
%description -n python3-fasteners %{common_description}
8962508
8962508
0533ce9
%prep
814c998
%autosetup -n fasteners-%{version}
227cd6e
%if %{without diskcache}
227cd6e
sed -r -i '/\b(diskcache)\b/d' requirements-test.txt
227cd6e
%endif
227cd6e
227cd6e
227cd6e
%generate_buildrequires
227cd6e
%pyproject_buildrequires %{?with_tests:requirements-test.txt}
0533ce9
0533ce9
0533ce9
%build
227cd6e
%pyproject_wheel
bdf5ee6
0533ce9
0533ce9
%install
227cd6e
%pyproject_install
227cd6e
%pyproject_save_files fasteners
0533ce9
bf165d9
bdf5ee6
%check
bf165d9
%if %{with tests}
16553c9
%pytest %{?!with_diskcache:--ignore=tests/test_reader_writer_lock.py} -v
227cd6e
%else
227cd6e
%pyproject_check_import -e 'fasteners.pywin32*'
4c6a7f3
%endif
0533ce9
bf165d9
227cd6e
%files -n python3-fasteners -f %{pyproject_files}
227cd6e
# pyproject_files handles LICENSE; verify with “rpm -qL -p …”
16553c9
%doc CHANGELOG.md
bf165d9
%doc README.md
bf165d9
0533ce9
0533ce9
%changelog
851f6f8
%autochangelog