2019-07-02 12:19:01 +00:00
|
|
|
%global pypi_name pytest
|
|
|
|
Name: python-%{pypi_name}
|
2021-06-17 11:00:12 +00:00
|
|
|
|
|
|
|
# For testing purposes, we package different versions on different Fedoras,
|
|
|
|
# because otherwise we would miss some dependencies (pytest 6.2 needs tox 3.20+)
|
|
|
|
# Please, don't write spec files like this in Fedora, it is forbidden.
|
|
|
|
%if 0%{?fedora} > 33 || 0%{?rhel} > 9
|
|
|
|
Version: 6.2.4
|
|
|
|
%else
|
2019-07-02 14:53:05 +00:00
|
|
|
Version: 4.4.2
|
2021-06-17 11:00:12 +00:00
|
|
|
%endif
|
|
|
|
|
2019-07-02 12:19:01 +00:00
|
|
|
Release: 0%{?dist}
|
|
|
|
Summary: Simple powerful testing with Python
|
|
|
|
License: MIT
|
|
|
|
URL: https://pytest.org
|
|
|
|
Source0: %{pypi_source}
|
|
|
|
|
2021-06-17 11:00:12 +00:00
|
|
|
%if v"%{version}" >= v"6.2"
|
|
|
|
# Fix Python 3.10 test issues
|
|
|
|
# Merged upstream, https://github.com/pytest-dev/pytest/pull/8555
|
|
|
|
# Rebased slightly
|
2021-07-12 23:29:17 +00:00
|
|
|
Patch2: https://src.fedoraproject.org/rpms/pytest/raw/cad86f73367eff59a1d6daff44d262c3852f01f9/f/8555.patch
|
2021-06-17 11:00:12 +00:00
|
|
|
%endif
|
|
|
|
|
2019-07-02 12:19:01 +00:00
|
|
|
BuildArch: noarch
|
2020-10-26 15:11:32 +00:00
|
|
|
BuildRequires: python3-devel
|
2019-07-02 12:19:01 +00:00
|
|
|
BuildRequires: pyproject-rpm-macros
|
|
|
|
|
|
|
|
%description
|
2020-04-15 14:44:04 +00:00
|
|
|
This is a pure Python package with executables. It has a test suite in tox.ini
|
|
|
|
and test dependencies specified via the [test] extra.
|
|
|
|
Building this tests:
|
|
|
|
- generating runtime and test dependencies by both tox.ini and extras
|
|
|
|
- pyproject.toml with the setuptools backend and setuptools-scm
|
|
|
|
- passing arguments into %%tox
|
2019-07-02 12:19:01 +00:00
|
|
|
|
|
|
|
%package -n python3-%{pypi_name}
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
%description -n python3-%{pypi_name}
|
2020-04-15 14:44:04 +00:00
|
|
|
%{summary}.
|
2019-07-02 12:19:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1 -n %{pypi_name}-%{version}
|
|
|
|
|
2021-06-17 11:00:12 +00:00
|
|
|
# Remove duplicate '>=' in setup.cfg
|
|
|
|
# https://github.com/pytest-dev/pytest/pull/8336
|
|
|
|
# https://github.com/pytest-dev/pytest/pull/8774
|
|
|
|
sed -i 's/>=>=/>=/' setup.cfg
|
|
|
|
|
2019-07-02 12:19:01 +00:00
|
|
|
|
|
|
|
%generate_buildrequires
|
2019-08-13 12:42:21 +00:00
|
|
|
%pyproject_buildrequires -x testing -t
|
2019-07-02 12:19:01 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%pyproject_install
|
2020-08-06 12:27:30 +00:00
|
|
|
%pyproject_save_files '*pytest' +auto
|
|
|
|
|
2019-07-02 12:19:01 +00:00
|
|
|
|
2019-07-18 08:50:13 +00:00
|
|
|
%check
|
2020-04-15 14:44:04 +00:00
|
|
|
# Only run one test (which uses a test-only dependency, hypothesis)
|
|
|
|
# See how to pass options trough the macro to tox, trough tox to pytest
|
2019-08-13 12:42:21 +00:00
|
|
|
%tox -- -- -k metafunc
|
2019-07-18 08:50:13 +00:00
|
|
|
|
2019-07-02 12:19:01 +00:00
|
|
|
|
2020-04-15 14:44:04 +00:00
|
|
|
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
2019-07-02 12:19:01 +00:00
|
|
|
%doc README.rst
|
|
|
|
%doc CHANGELOG.rst
|
|
|
|
%license LICENSE
|