a2123d2
%global srcname anyio
a2123d2
30bd7f9
%if %{defined fedora}
30bd7f9
# As of 2022-03-04, neither EL9 or EPEL9 have python3-uvloop
30bd7f9
%bcond_without tests
30bd7f9
# As of 2022-03-04, neither EL9 or EPEL9 have python3-sphinx-autodoc-typehints
30bd7f9
%bcond_without docs
30bd7f9
%endif
2cbcbc2
a2123d2
%global common_description %{expand:
30bd7f9
AnyIO is an asynchronous networking and concurrency library that works on top
30bd7f9
of either asyncio or trio.  It implements trio-like structured concurrency (SC)
30bd7f9
on top of asyncio, and works in harmony with the native SC of trio itself.}
a2123d2
30bd7f9
Name:           python-%{srcname}
30bd7f9
Version:        3.5.0
8876b7e
Release:        5%{?dist}
a2123d2
Summary:        Compatibility layer for multiple asynchronous event loop implementations
a2123d2
License:        MIT
30bd7f9
URL:            https://github.com/agronholm/anyio
30bd7f9
Source:         %pypi_source
b9304c6
b9304c6
# Support for pytest 7
b9304c6
# Fixes https://bugzilla.redhat.com/2069194
b9304c6
# https://github.com/agronholm/anyio/commit/58fcb0c495
b9304c6
# setup.cfg hunk manually removed (it failed to apply)
b9304c6
Patch:          pytest7.patch
b9304c6
a2647b7
# Skip @asyncio.coroutine tests on Python 3.11+ where it no longer exists
a2647b7
Patch:          https://github.com/agronholm/anyio/pull/431.patch
a2647b7
4d40005
# Cancel messages are only supported on Python 3.9 and 3.10
4d40005
# https://github.com/agronholm/anyio/commit/95f43f8db1
4d40005
Patch:           0001-Fixed-cancel-message-related-test-failure-on-py3.11.patch
4d40005
a2123d2
BuildArch:      noarch
a2123d2
a2123d2
a2123d2
%description %{common_description}
a2123d2
a2123d2
30bd7f9
%package -n python3-%{srcname}
a2123d2
Summary:        %{summary}
30bd7f9
BuildRequires:  python3-devel
a2123d2
a2123d2
30bd7f9
%description -n python3-%{srcname} %{common_description}
a2123d2
a2123d2
30bd7f9
%pyproject_extras_subpkg -n python3-%{srcname} trio
120c9f2
120c9f2
30bd7f9
%if %{with docs}
447c872
%package -n python-%{srcname}-doc
447c872
Summary:        anyio documentation
30bd7f9
30bd7f9
447c872
%description -n python-%{srcname}-doc
447c872
Documentation for anyio
30bd7f9
%endif
447c872
447c872
a2123d2
%prep
447c872
%autosetup -n %{srcname}-%{version} -p1
30bd7f9
30bd7f9
# disable coverage test requirement
30bd7f9
sed -e '/coverage/d' -i setup.cfg
30bd7f9
4d40005
# Disable some tests till uvloop is compatible with Python 3.11
4d40005
# upstream discussion: https://github.com/agronholm/anyio/issues/439
4d40005
sed -i '/uvloop/d' setup.cfg
4d40005
30bd7f9
# despite the prescense of a pytest "network" marker, socket tests still fail
30bd7f9
# without internet access
30bd7f9
rm tests/test_sockets.py
30bd7f9
30bd7f9
30bd7f9
%generate_buildrequires
30bd7f9
%pyproject_buildrequires -x trio%{?with_tests:,test}%{?with_docs:,doc}
30bd7f9
a2123d2
a2123d2
%build
447c872
%pyproject_wheel
30bd7f9
%if %{with docs}
447c872
# generate html docs
447c872
PYTHONPATH=${PWD} sphinx-build-3 docs html
447c872
# remove the sphinx-build leftovers
447c872
rm -rf html/.{doctrees,buildinfo}
30bd7f9
%endif
a2123d2
4365c9b
a2123d2
%install
447c872
%pyproject_install
30bd7f9
%pyproject_save_files %{srcname}
a2123d2
a2123d2
2cbcbc2
%if %{with tests}
a2123d2
%check
447c872
%pytest -m "not network"
2cbcbc2
%endif
a2123d2
a2123d2
30bd7f9
%files -n python3-%{srcname} -f %{pyproject_files}
a2123d2
%doc README.rst
447c872
4365c9b
30bd7f9
%if %{with docs}
447c872
%files -n python-%{srcname}-doc
447c872
%doc html
447c872
%license LICENSE
30bd7f9
%endif
a2123d2
a2123d2
a2123d2
%changelog
8876b7e
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-5
8876b7e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
8876b7e
2709df0
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-4
2709df0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
2709df0
37c1b0b
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 3.5.0-3
37c1b0b
- Rebuilt for Python 3.11
37c1b0b
b9304c6
* Tue Mar 29 2022 Miro Hrončok <mhroncok@redhat.com> - 3.5.0-2
b9304c6
- Fix for pytest7
b9304c6
- Fixes: rhbz#2069194
b9304c6
30bd7f9
* Fri Mar 04 2022 Carl George <carl@george.computer> - 3.5.0-1
30bd7f9
- Latest upstream rhbz#2007952
30bd7f9
- Enable test suite
30bd7f9
- Only run test on Fedora
30bd7f9
- Only build docs on Fedora
30bd7f9
0462700
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-3
0462700
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
0462700
120c9f2
* Fri Oct 08 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 3.3.1-2
120c9f2
- Add metapackage for “trio” extra
120c9f2
b0cf597
* Wed Sep 08 2021 Fabian Affolter <mail@fabian-affolter.ch> - 3.3.1-1
b0cf597
- Update to latest upstream release 3.3.1 (closes rhbz#1975540)
b0cf597
1f5ed57
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.0-2
1f5ed57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
1f5ed57
4365c9b
* Tue Jun 22 2021 Carl George <carl@george.computer> - 3.2.0-1
4365c9b
- Latest upstream
4365c9b
- Fixes: rhbz#1926501
4365c9b
- Fixes: rhbz#1900506
4365c9b
d414fdc
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.0.2-2
d414fdc
- Rebuilt for Python 3.10
d414fdc
447c872
* Thu Jan 28 2021 Dan Čermák <dan.cermak@cgc-instruments.com> - 2.0.2-1
447c872
- New upstream release 2.0.2
447c872
f65f1c4
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-3
f65f1c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
f65f1c4
36b4fd3
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
36b4fd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
36b4fd3
db149a8
* Tue Jun 02 2020 Carl George <carl@george.computer> - 1.3.1-1
db149a8
- Latest upstream
db149a8
8e5a874
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.2.3-3
8e5a874
- Rebuilt for Python 3.9
8e5a874
baf20e7
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-2
baf20e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
baf20e7
7de20cf
* Mon Jan 13 2020 Carl George <carl@george.computer> - 1.2.3-1
7de20cf
- Latest upstream rhbz#1786957
7de20cf
a7c62cc
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-4
a7c62cc
- Rebuilt for Python 3.8.0rc1 (#1748018)
a7c62cc
a111ce0
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-3
a111ce0
- Rebuilt for Python 3.8
a111ce0
55bfa6b
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
55bfa6b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
55bfa6b
a2123d2
* Thu May 16 2019 Carl George <carl@george.computer> - 1.0.0-1
a2123d2
- Initial package