pyproject-rpm-macros/tests/python-pytest.spec

54 lines
1.2 KiB
RPMSpec
Raw Normal View History

2019-07-02 12:19:01 +00:00
%global pypi_name pytest
Name: python-%{pypi_name}
2019-07-02 14:53:05 +00:00
Version: 4.4.2
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}
BuildArch: noarch
BuildRequires: pyproject-rpm-macros
%description
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}
%{summary}.
2019-07-02 12:19:01 +00:00
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%generate_buildrequires
%pyproject_buildrequires -x testing -t
2019-07-02 12:19:01 +00:00
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files '*pytest' +auto
2019-07-02 12:19:01 +00:00
%check
# 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
%tox -- -- -k metafunc
2019-07-02 12:19:01 +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