Sync from SUSE:SLFO:Main python-anyio revision 7fd699623429721ee668eb6d1ec5d3fb

This commit is contained in:
Adrian Schröter 2024-05-03 20:03:58 +02:00
commit cf019498cc
5 changed files with 663 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
anyio-3.7.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

500
python-anyio.changes Normal file
View File

@ -0,0 +1,500 @@
-------------------------------------------------------------------
Thu Nov 16 15:31:07 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 3.7.1:
* Fixed sending large buffers via UNIX stream sockets on
asyncio
* Fixed several minor documentation issues (broken links to
classes, missing classes or attributes)
* Dropped support for Python 3.6
* Improved type annotations:
* Several functions and methods that were previously annotated
as accepting ``Coroutine[Any, Any, Any]`` as the return type
of the callable have been amended to accept ``Awaitable[Any]``
instead, to allow a slightly broader set of coroutine-like
inputs, like ``async_generator_asend`` objects returned from
the ``asend()`` method of async generators, and to match
the ``trio`` annotations:
* ``anyio.run()``
* ``anyio.from_thread.run()``
* ``TaskGroup.start_soon()``
* ``TaskGroup.start()``
* ``BlockingPortal.call()``
* ``BlockingPortal.start_task_soon()``
* ``BlockingPortal.start_task()``
* Changed ``TLSAttribute.shared_ciphers`` to match the
documented semantics of ``SSLSocket.shared_ciphers``
of always returning ``None`` for client-side streams
* Fixed ``CapacityLimiter`` on the asyncio backend to order
waiting tasks in the FIFO order (instead of LIFO)
* Fixed ``CancelScope.cancel()`` not working on asyncio if
called before entering the scope
* Fixed ``open_signal_receiver()`` inconsistently yielding
integers instead of ``signal.Signals`` instances on the
``trio`` backend
* Fixed ``to_thread.run_sync()`` hanging on asyncio if the
target callable raises ``StopIteration``
* Fixed ``start_blocking_portal()`` raising an unwarranted
* ``RuntimeError: This portal is not running`` if a task raises
an exception that causes the event loop to be closed
* Fixed ``current_effective_deadline()`` not returning ``-inf``
on asyncio when the currently active cancel scope has been
cancelled (PR by Ganden Schaffner)
* Fixed the ``OP_IGNORE_UNEXPECTED_EOF`` flag in an SSL context
created by default in ``TLSStream.wrap()`` being inadvertently
set on Python 3.11.3 and 3.10.11
* Fixed ``CancelScope`` to properly handle asyncio task
uncancellation on Python 3.11
* Fixed ``OSError`` when trying to use
``create_tcp_listener()`` to bind to a link-local
* IPv6 address (and worked around related bugs in ``uvloop``)
* Worked around a `PyPy bug
<https://foss.heptapod.net/pypy/pypy/-/issues/3938>`_
when using ``anyio.getaddrinfo()`` with for IPv6 link-local
addresses containing interface names
- drop fix-failing-tls-tests.patch
support-trio-0.22.patch: obsolete
-------------------------------------------------------------------
Thu Nov 16 15:30:25 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 3.7.1:
* Fixed sending large buffers via UNIX stream sockets on
asyncio
* Fixed several minor documentation issues (broken links to
classes, missing classes or
* attributes)
* **3.7.0**
* Dropped support for Python 3.6
* Improved type annotations:
* Several functions and methods that were previously annotated
as accepting
* ``Coroutine[Any, Any, Any]`` as the return type of the
callable have been amended to
* accept ``Awaitable[Any]`` instead, to allow a slightly
broader set of coroutine-like
* inputs, like ``async_generator_asend`` objects returned from
the ``asend()`` method
* of async generators, and to match the ``trio`` annotations:
* ``anyio.run()``
* ``anyio.from_thread.run()``
* ``TaskGroup.start_soon()``
* ``TaskGroup.start()``
* ``BlockingPortal.call()``
* ``BlockingPortal.start_task_soon()``
* ``BlockingPortal.start_task()``
* Note that this change involved only changing the type
annotations; run-time
* functionality was not altered.
* The ``TaskStatus`` class is now a generic protocol, and
should be parametrized to
* indicate the type of the value passed to
``task_status.started()``
* The ``Listener`` class is now covariant in its stream type
* ``create_memory_object_stream()`` now allows passing only
``item_type``
* Object receive streams are now covariant and object send
streams are correspondingly
* contravariant
* Changed ``TLSAttribute.shared_ciphers`` to match the
documented semantics of
* ``SSLSocket.shared_ciphers`` of always returning ``None`` for
client-side streams
* Fixed ``CapacityLimiter`` on the asyncio backend to order
waiting tasks in the FIFO
* order (instead of LIFO) (PR by Conor Stevenson)
* Fixed ``CancelScope.cancel()`` not working on asyncio if
called before entering the
* scope
* Fixed ``open_signal_receiver()`` inconsistently yielding
integers instead of
* ``signal.Signals`` instances on the ``trio`` backend
* Fixed ``to_thread.run_sync()`` hanging on asyncio if the
target callable raises
* ``StopIteration``
* Fixed ``start_blocking_portal()`` raising an unwarranted
* ``RuntimeError: This portal is not running`` if a task raises
an exception that causes
* the event loop to be closed
* Fixed ``current_effective_deadline()`` not returning ``-inf``
on asyncio when the
* currently active cancel scope has been cancelled (PR by
Ganden Schaffner)
* Fixed the ``OP_IGNORE_UNEXPECTED_EOF`` flag in an SSL context
created by default in
* ``TLSStream.wrap()`` being inadvertently set on Python 3.11.3
and 3.10.11
* Fixed ``CancelScope`` to properly handle asyncio task
uncancellation on Python 3.11
* (PR by Nikolay Bryskin)
* Fixed ``OSError`` when trying to use
``create_tcp_listener()`` to bind to a link-local
* IPv6 address (and worked around related bugs in ``uvloop``)
* Worked around a `PyPy bug
<https://foss.heptapod.net/pypy/pypy/-/issues/3938>`_
* when using ``anyio.getaddrinfo()`` with for IPv6 link-local
addresses containing
* interface names
-------------------------------------------------------------------
Thu Nov 2 10:42:51 UTC 2023 - Jiri Slaby <jslaby@suse.cz>
- add tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch (kernel
6.6 fix)
-------------------------------------------------------------------
Thu May 4 07:29:22 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch fix-failing-tls-tests.patch:
* Fix test failures with Python TLS changes.
-------------------------------------------------------------------
Fri Apr 21 12:21:49 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:39:54 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Tue Mar 7 06:29:28 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-trio-0.22.patch:
* Support trio >= 0.22 just enough for asyncclick.
-------------------------------------------------------------------
Fri Dec 16 15:06:08 UTC 2022 - Markéta Machová <mmachova@suse.com>
- Skip trio exception tests for now
* https://github.com/agronholm/anyio/issues/508
* https://github.com/agronholm/anyio/commit/787cb0c2e53c2a3307873d202fbd49dc5eac4e96
-------------------------------------------------------------------
Mon Nov 21 21:04:03 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 3.6.2:
- Pinned Trio to < 0.22 to avoid incompatibility with AnyIO's ``ExceptionGroup`` class
causing ``AttributeError: 'NonBaseMultiError' object has no attribute '_exceptions'``
(AnyIO 4 is unaffected)
- Fixed exception handler in the asyncio test runner not properly handling a context
that does not contain the ``exception`` key
- Fixed ``TypeError`` in ``get_current_task()`` on asyncio when using a custom ``Task`` factory
- Updated type annotations on ``run_process()`` and ``open_process()``:
* ``command`` now accepts accepts bytes and sequences of bytes
* ``stdin``, ``stdout`` and ``stderr`` now accept file-like objects
- Changed the pytest plugin to run both the setup and teardown phases of asynchronous
generator fixtures within a single task to enable use cases such as cancel scopes and
task groups where a context manager straddles the ``yield``
- drop anyio-pytest7.patch (upstream)
-------------------------------------------------------------------
Sun Mar 27 18:32:27 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Add anyio-pytest7.patch -- gh#agronholm/anyio#420
-------------------------------------------------------------------
Tue Feb 15 16:06:39 UTC 2022 - Dirk Müller <dmueller@suse.com>
- skip some tests for older distros (lack of TLSv1.3 support)
-------------------------------------------------------------------
Sat Jan 15 16:36:24 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 3.5.0:
- Added ``start_new_session`` keyword argument to ``run_process()`` and ``open_process()``
- Fixed deadlock in synchronization primitives on asyncio which can happen if a task acquiring a
primitive is hit with a native (not AnyIO) cancellation with just the right timing, leaving the
next acquiring task waiting forever
- Added workaround for bpo-46313_ to enable compatibility with OpenSSL 3.0
-------------------------------------------------------------------
Mon Nov 29 12:01:51 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 3.4.0:
* Added context propagation to/from worker threads in ``to_thread.run_sync()``,
``from_thread.run()`` and ``from_thread.run_sync()``
* Fixed race condition in ``Lock`` and ``Semaphore`` classes when a task waiting on ``acquire()``
is cancelled while another task is waiting to acquire the same primitive
* Fixed async context manager's ``__aexit__()`` method not being called in
``BlockingPortal.wrap_async_context_manager()`` if the host task is cancelled
* Fixed worker threads being marked as being event loop threads in sniffio
* Fixed task parent ID not getting set to the correct value on asyncio
* Enabled the test suite to run without IPv6 support, trio or pytest plugin autoloading
-------------------------------------------------------------------
Tue Oct 26 20:18:21 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 3.3.4:
* Fixed ``BrokenResourceError`` instead of ``EndOfStream`` being raised in
``TLSStream`` when the peer abruptly closes the connection while
``TLSStream`` is receiving data with ``standard_compatible=False`` set
-------------------------------------------------------------------
Sat Oct 16 21:03:37 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 3.3.3:
* Fixed UNIX socket listener not setting accepted sockets to non-blocking
mode on asyncio
* Changed unconnected UDP sockets to be always bound to a local port (on
"any" interface) to avoid errors on asyncio + Windows
* Fixed cancellation problem on asyncio where level-triggered cancellation
for **all** parent cancel scopes would not resume after exiting a
shielded nested scope
-------------------------------------------------------------------
Fri Sep 17 19:23:22 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to v3.3.1
* Added missing documentation for the ExceptionGroup.exceptions
attribute
* Changed the asyncio test runner not to use uvloop by default
(to match the behavior of anyio.run())
* Fixed RuntimeError on asyncio when a CancelledError is raised
from a task spawned through a BlockingPortal (#357)
* Fixed asyncio warning about a Future with an exception that
was never retrieved which happened when a socket was already
written to but the peer abruptly closed the connection
- Release 3.3.0
* Added asynchronous Path class
* Added the wrap_file() function for wrapping existing files as
asynchronous file objects
* Relaxed the type of the path initializer argument to
FileReadStream and FileWriteStream so they accept any
path-like object (including the new asynchronous Path class)
* Dropped unnecessary dependency on the async_generator library
* Changed the generics in AsyncFile so that the methods
correctly return either str or bytes based on the argument to
open_file()
* Fixed an asyncio bug where under certain circumstances, a
stopping worker thread would still accept new assignments,
leading to a hang
- Release 3.2.1
* Fixed idle thread pruning on asyncio sometimes causing an
expired worker thread to be assigned a task
- Release 3.2.0
* Added Python 3.10 compatibility
* Added the ability to close memory object streams synchronously
(including support for use as a synchronous context manager)
* Changed the default value of the use_uvloop asyncio backend
option to False to prevent unsafe event loop policy changes in
different threads
* Fixed to_thread.run_sync() hanging on the second call on
asyncio when used with loop.run_until_complete()
* Fixed to_thread.run_sync() prematurely marking a worker thread
inactive when a task await on the result is cancelled
* Fixed ResourceWarning about an unclosed socket when UNIX
socket connect fails on asyncio
* Fixed the type annotation of open_signal_receiver() as a
synchronous context manager
* Fixed the type annotation of DeprecatedAwaitable(|List|Float).
__await__ to match the typing.Awaitable protocol
- Unskip python36: uvloop is only optional
-------------------------------------------------------------------
Fri Sep 17 06:59:56 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>
- Do not build for python 3.6: the required dependency uvloop does
no longer support Python 3.6 since version 0.16.
-------------------------------------------------------------------
Thu Jun 3 09:17:54 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
- Update to 3.1.0:
* Added env and cwd keyword arguments to run_process() and
open_process.
* Added support for mutation of CancelScope.shield
(PR by John Belmonte)
* Added the sleep_forever() and sleep_until() functions
* Changed asyncio task groups so that if the host and child tasks
have only raised CancelledErrors, just one CancelledError will
now be raised instead of an ExceptionGroup, allowing asyncio to
ignore it when it propagates out of the task
* Changed task names to be converted to str early on asyncio
(PR by Thomas Grainger)
* Fixed sniffio._impl.AsyncLibraryNotFoundError: unknown async
library, or not in async context on asyncio and Python 3.6 when
to_thread.run_sync() is used from loop.run_until_complete()
* Fixed odd ExceptionGroup: 0 exceptions were raised in the task
group appearing under certain circumstances on asyncio
* Fixed wait_all_tasks_blocked() returning prematurely on asyncio
when a previously blocked task is cancelled
(PR by Thomas Grainger)
* Fixed declared return type of TaskGroup.start() (it was
declared as None, but anything can be returned from it)
* Fixed TextStream.extra_attributes raising AttributeError
(PR by Thomas Grainger)
* Fixed await maybe_async(current_task()) returning None
(PR by Thomas Grainger)
* Fixed: pickle.dumps(current_task()) now correctly raises
TypeError instead of pickling to None (PR by Thomas Grainger)
* Fixed return type annotation of Event.wait() (bool → None)
(PR by Thomas Grainger)
* Fixed return type annotation of RunVar.get() to return either
the type of the default value or the type of the contained
value (PR by Thomas Grainger)
* Fixed a deprecation warning message to refer to maybe_async()
and not maybe_awaitable() (PR by Thomas Grainger)
* Filled in argument and return types for all functions and
methods previously missing them (PR by Thomas Grainger)
- Update to 3.0.1:
* Fixed to_thread.run_sync() raising RuntimeError on asyncio
when no "root" task could be found for setting up a cleanup
callback. This was a problem at least on Tornado and possibly
also Twisted in asyncio compatibility mode. The life of worker
threads is now bound to the the host task of the topmost cancel
scope hierarchy starting from the current one, or if no cancel
scope is active, the current task.
- Update to 3.0.0:
* Curio support has been dropped (see the :doc:`FAQ <faq>` as for
why)
* API changes:
- BACKWARDS INCOMPATIBLE Submodules under anyio.abc. have been
made private (use only anyio.abc from now on).
- BACKWARDS INCOMPATIBLE The following method was previously a
coroutine method and has been converted into a synchronous
one:
* MemoryObjectReceiveStream.receive_nowait()
- The following functions and methods are no longer
asynchronous but can still be awaited on (doing so will emit
a deprecation warning):
* current_time()
* current_effective_deadline()
* get_current_task()
* get_running_tasks()
* CancelScope.cancel()
* CapacityLimiter.acquire_nowait()
* CapacityLimiter.acquire_on_behalf_of_nowait()
* Condition.release()
* Event.set()
* Lock.release()
* MemoryObjectSendStream.send_nowait()
* Semaphore.release()
- The following functions now return synchronous context
managers instead of asynchronous context managers (and emit
deprecation warnings if used as async context managers):
* fail_after()
* move_on_after()
* open_cancel_scope() (now just CancelScope(); see below)
* open_signal_receiver()
- The following functions and methods have been renamed/moved
(will now emit deprecation warnings when you use them by
their old names):
* create_blocking_portal() →
anyio.from_thread.BlockingPortal()
* create_capacity_limiter() → anyio.CapacityLimiter()
* create_event() → anyio.Event()
* create_lock() → anyio.Lock()
* create_condition() → anyio.Condition()
* create_semaphore() → anyio.Semaphore()
* current_default_worker_thread_limiter() →
anyio.to_thread.current_default_thread_limiter()
* open_cancel_scope() → anyio.CancelScope()
* run_sync_in_worker_thread() → anyio.to_thread.run_sync()
* run_async_from_thread() → anyio.from_thread.run()
* run_sync_from_thread() → anyio.from_thread.run_sync()
* BlockingPortal.spawn_task → BlockingPortal.start_task_soon
* CapacityLimiter.set_total_tokens() → limiter.total_tokens
= ...
* TaskGroup.spawn() → TaskGroup.start_soon()
- BACKWARDS INCOMPATIBLE start_blocking_portal() must now be
used as a context manager (it no longer returns a
BlockingPortal, but a context manager that yields one)
- BACKWARDS INCOMPATIBLE The
BlockingPortal.stop_from_external_thread() method (use
portal.call(portal.stop) instead now)
- BACKWARDS INCOMPATIBLE The SocketStream and SocketListener
classes were made non-generic
- Made all non-frozen dataclasses hashable with eq=False
- Removed __slots__ from BlockingPortal
See the :doc:`migration documentation <migration>` for
instructions on how to deal with these changes.
* Improvements to running synchronous code:
- Added the run_sync_from_thread() function
- Added the run_sync_in_process() function for running code in
worker processes (big thanks to Richard Sheridan for his help
on this one!)
* Improvements to sockets and streaming:
- Added the UNIXSocketStream class which is capable of sending
and receiving file descriptors
- Added the FileReadStream and FileWriteStream classes
- create_unix_listener() now removes any existing socket at the
given path before proceeding (instead of raising OSError:
Address already in use)
* Improvements to task groups and cancellation:
- Added the TaskGroup.start() method and a corresponding
BlockingPortal.start_task() method
- Added the name argument to BlockingPortal.start_task_soon()
(renamed from BlockingPortal.spawn_task())
- Changed CancelScope.deadline to be writable
- Added the following functions in the anyio.lowlevel module:
* checkpoint()
* checkpoint_if_cancelled()
* cancel_shielded_checkpoint()
* Improvements and changes to synchronization primitives:
- Added the Lock.acquire_nowait(), Condition.acquire_nowait()
and Semaphore.acquire_nowait() methods
- Added the statistics() method to Event, Lock, Condition,
Semaphore, CapacityLimiter, MemoryObjectReceiveStream and
MemoryObjectSendStream
- Lock and Condition can now only be released by the task that
acquired them. This behavior is now consistent on all
backends whereas previously only Trio enforced this.
- The CapacityLimiter.total_tokens property is now writable and
CapacityLimiter.set_total_tokens() has been deprecated
- Added the max_value property to Semaphore
* Asyncio specific improvements (big thanks to Thomas Grainger
for his effort on most of these!):
- Cancel scopes are now properly enforced with native asyncio
coroutine functions (without any explicit AnyIO checkpoints)
- Changed the asyncio CancelScope to raise a RuntimeError if a
cancel scope is being exited before it was even entered
- Changed the asyncio test runner to capture unhandled
exceptions from asynchronous callbacks and unbound native
tasks which are then raised after the test function (or async
fixture setup or teardown) completes
- Changed the asyncio TaskGroup.start_soon() (formerly spawn())
method to call the target function immediately before
starting the task, for consistency across backends
- Changed the asyncio TaskGroup.start_soon() (formerly spawn())
method to avoid the use of a coroutine wrapper on Python 3.8+
and added a hint for hiding the wrapper in tracebacks on
earlier Pythons (supported by Pytest, Sentry etc.)
- Changed the default thread limiter on asyncio to use a RunVar
so it is scoped to the current event loop, thus avoiding
potential conflict among multiple running event loops
- Thread pooling is now used on asyncio with
run_sync_in_worker_thread()
- Fixed current_effective_deadline() raising KeyError on
asyncio when no cancel scope is active
* Added the RunVar class for scoping variables to the running
event loop
-------------------------------------------------------------------
Mon Mar 15 05:57:41 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 2.2.0:
* Added the ``maybe_async()`` and ``maybe_async_cm()`` functions to facilitate forward compatibility with AnyIO 3
* Fixed socket stream bug on asyncio where receiving a half-close from the peer would shut down the entire connection
* Fixed native task names not being set on asyncio on Python 3.8+
* Fixed ``TLSStream.send_eof()`` raising ``ValueError`` instead of the expected ``NotImplementedError``
* Fixed ``open_signal_receiver()`` on asyncio and curio hanging if the cancel scope was cancelled before the function could run
* Fixed Trio test runner causing unwarranted test errors on ``BaseException``s
* Fixed formatted output of ``ExceptionGroup`` containing too many newlines
* Added the ``spawn_task()`` and ``wrap_async_context_manager()`` methods to ``BlockingPortal``
* Added the ``handshake_timeout`` and ``error_handler`` parameters to ``TLSListener``
* Fixed ``Event`` objects on the trio backend not inheriting from ``anyio.abc.Event``
* Fixed ``run_sync_in_worker_thread()`` raising ``UnboundLocalError`` on asyncio when cancelled
* Fixed ``send()`` on socket streams not raising any exception on asyncio, and an unwrapped
* ``BrokenPipeError`` on trio and curio when the peer has disconnected
* Fixed ``MemoryObjectSendStream.send()`` raising ``BrokenResourceError`` when the last receiver is closed right after receiving the item
* Fixed ``ValueError: Invalid file descriptor: -1`` when closing a ``SocketListener`` on asyncio
-------------------------------------------------------------------
Sat Jan 30 18:29:29 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Initial specfile for version 2.0.2
- required by jupyter_server 1.2.3

104
python-anyio.spec Normal file
View File

@ -0,0 +1,104 @@
#
# spec file for package python-anyio
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-anyio
Version: 3.7.1
Release: 0
Summary: High level compatibility layer for asynchronous event loop implementations
License: MIT
URL: https://github.com/agronholm/anyio
Source: https://files.pythonhosted.org/packages/source/a/anyio/anyio-%{version}.tar.gz
# PATCH-FIX-UPSTREAM see gh#agronholm/anyio#626
Patch2: tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch
BuildRequires: %{python_module contextlib2 if %python-base < 3.7}
BuildRequires: %{python_module dataclasses if %python-base < 3.7}
BuildRequires: %{python_module idna >= 2.8}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module psutil >= 5.9}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module sniffio >= 1.1}
BuildRequires: %{python_module toml}
BuildRequires: %{python_module typing_extensions if %python-base < 3.8}
BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros >= 20210127.3a18043
# SECTION test requirements
BuildRequires: %{python_module hypothesis >= 4.0}
BuildRequires: %{python_module mock >= 4.0 if %python-base < 3.8}
BuildRequires: %{python_module pytest >= 7.0}
BuildRequires: %{python_module pytest-mock >= 3.6.1}
BuildRequires: %{python_module trio >= 0.16}
BuildRequires: %{python_module trustme}
# /SECTION
BuildRequires: fdupes
Requires: python-idna >= 2.8
Requires: python-sniffio >= 1.1
%if 0%{?python_version_nodots} < 38
Requires: python-typing_extensions
%endif
%if 0%{?python_version_nodots} < 37
Requires: python-contextvars
Requires: python-dataclasses
%endif
Suggests: python-trio >= 0.16
BuildArch: noarch
%python_subpackages
%description
Asynchronous compatibility API that allows applications and libraries written
against it to run unmodified on asyncio, curio and trio.
%prep
%autosetup -p1 -n anyio-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
sed -i '/filterwarnings/,/^]/ { /"error"/ d}' pyproject.toml
# bind and resolution failures inside OBS
donttest+=" or (TestTCPStream and (ipv4 or ipv6))"
donttest+=" or (TestTCPListener and (ipv4 or ipv6))"
donttest+=" or (TestConnectedUDPSocket and (ipv4 or ipv6))"
donttest+=" or (TestUDPSocket and (ipv4 or ipv6))"
# wrong localhost address
donttest+=" or (TestTCPStream and test_happy_eyeballs)"
donttest+=" or (TestTCPStream and test_connection_refused)"
donttest+=" or test_bind_link_local"
# does not raise an exception
donttest+=" or (TestTLSStream and test_ragged_eofs)"
%if 0%{?suse_version} < 1550
donttest+=" or (test_send_eof_not_implemented)"
%endif
donttest+=" or (test_exception_group and trio)"
# Fail with python 3.12
donttest+=" or (test_properties and trio)"
donttest+=" or (test_properties and asyncio)"
%pytest -m "not network" -k "not (${donttest:4})" -ra
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/anyio
%{python_sitelib}/anyio-%{version}*-info
%changelog

View File

@ -0,0 +1,33 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Thu, 2 Nov 2023 11:37:44 +0100
Subject: tests: test_fileio.py: don't follow symlinks in /dev
Patch-mainline: submitted https://github.com/agronholm/anyio/pull/626
References: fix for kernel 6.6
There might be a broken one like /dev/log and this causes the tests to
fail.
This is highly is unpredictable, because os.scandir() sometimes returns
a block device, sometimes the broken link is hit.
So pass follow_symlinks=False to entry.stat().
---
tests/test_fileio.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_fileio.py b/tests/test_fileio.py
index 9e6b2a8325..c4801187db 100644
--- a/tests/test_fileio.py
+++ b/tests/test_fileio.py
@@ -218,7 +218,7 @@ class TestPath:
assert not await Path("/btelkbee").is_block_device()
with os.scandir("/dev") as iterator:
for entry in iterator:
- if stat.S_ISBLK(entry.stat().st_mode):
+ if stat.S_ISBLK(entry.stat(follow_symlinks=False).st_mode):
assert await Path(entry.path).is_block_device()
break
else:
--
2.42.0