From db5d0069d42ae5289f688b92fac7fc4d1112ba17 Mon Sep 17 00:00:00 2001 From: Carl George Date: Apr 20 2022 19:38:01 +0000 Subject: Renamed from python3-pytest-asyncio (resolves: rhbz#2076825) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cfacec1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +pytest-asyncio-*.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index b4e8884..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-pytest-asyncio - -The python-pytest-asyncio package diff --git a/python-pytest-asyncio.spec b/python-pytest-asyncio.spec new file mode 100644 index 0000000..762f417 --- /dev/null +++ b/python-pytest-asyncio.spec @@ -0,0 +1,81 @@ +%global srcname pytest-asyncio +%global _description %{expand: +pytest-asyncio is an Apache2 licensed library, written in Python, for testing +asyncio code with pytest. + +asyncio code is usually written in the form of coroutines, which makes it +slightly more difficult to test using normal testing tools. pytest-asyncio +provides useful fixtures and markers to make testing easier.} + +%if %{undefined el9} +# EL9 missing pytest-trio +%bcond_without tests +%endif + +Name: python-%{srcname} +Version: 0.18.3 +Release: %autorelease +Summary: Pytest support for asyncio +License: ASL 2.0 +URL: https://github.com/pytest-dev/pytest-asyncio +Source: %pypi_source +BuildArch: noarch +BuildRequires: python3-devel + + +%description %{_description} + + +%package -n python3-%{srcname} +Summary: %{summary} + + +%description -n python3-%{srcname} %{_description} + + +%prep +%autosetup -n %{srcname}-%{version} + +# disable code quality checks in "testing" extras +sed -e '/coverage==/d' \ + -e '/mypy ==/d' \ + -i setup.cfg + +%if %{defined el9} +# EL9 has setuptools_scm 6.0.1 that works +sed -e '/setuptools_scm/ s/>=6.2//' -i pyproject.toml +%endif + + +%generate_buildrequires +# upstream also has tox that invokes make that invokes pytest... +# we install the [testing] extra and will invoke pytest directly instead +%pyproject_buildrequires %{?with_tests:-x testing} + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files pytest_asyncio + + +%check +%if %{with tests} +# tests/modes/test_legacy_mode.py fails when pytest is invoked by /usr/bin/pytest +# using python -m pytest works: +%global __pytest %{python3} -m pytest +%pytest +%else +%pyproject_check_import +%endif + + +%files -n python3-%{srcname} -f %{pyproject_files} +%doc README.rst CHANGELOG.rst + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..08b0886 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pytest-asyncio-0.18.3.tar.gz) = 49ff4827a2beed5679d2648bacb898b624fac38ce15054a550015de9d936b23f9f211a51e314b2a3ab2da90c50b56849948c62cfda17ac9e4a67068e2a62d4b5