Skip to content

Commit

Permalink
Updated changelog for v2.0.0 final
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Sep 11, 2020
1 parent 058e618 commit 3e3f988
Showing 1 changed file with 115 additions and 76 deletions.
191 changes: 115 additions & 76 deletions docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,121 +3,160 @@ Version history

This library adheres to `Semantic Versioning 2.0 <http:https://semver.org/>`_.

**UNRELEASED**
**2.0.0**

- Fixed TLS handshake failure in ``connect_tcp()`` not closing the connected socket

**2.0.0rc2**

- Changed the ``repr()`` of ``ExceptionGroup`` to match trio's ``MultiError``
- Fixed ``TLSStream`` not relaying the extra attributes from its transport stream
- Fixed incorrect type annotations of some ``TLSAttribute`` members

**2.0.0rc1**

- **BACKWARDS INCOMPATIBLE** Replaced individual stream/listener attributes with a system of
typed extra attributes which traverses the entire chain of wrapped streams/listeners to find the
attribute being looked for
- **BACKWARDS INCOMPATIBLE** Merged ``connect_tcp_with_tls()`` back into ``connect_tcp()``
- Added the ``tls_standard_compatible`` argument to ``connect_tcp()`` (this was mistakenly omitted
when ``connect_tcp()`` was split in two)
- Fixed Hypothesis support in the pytest plugin (it was not actually running the Hypothesis tests
at all)

**2.0.0b2**

- Simplified the cancellation logic in curio's cancel scopes (fixes runaway ``curio.TaskTimeout``
exceptions)
- Fixed return type annotation for ``BlockingPortal.call()`` to return the coroutine function's
return value and not the coroutine object
- Changed the logic in ``MemoryObjectReceiveStream.receive()`` to ignore the cancellation exception
instead of passing the item to the next receiver or the buffer

**2.0.0b1**

- New features:
- General new features:

- Added support for subprocesses
- Added support for "blocking portals" which allow running functions in the event loop thread
from external threads
- Added the ``anyio.aclose_forcefully()`` function for closing asynchronous resources as quickly
as possible
- Added support for ``ProactorEventLoop`` on the asyncio backend. This allows asyncio
applications to use AnyIO on Windows even without using AnyIO as the entry point.
- Added memory object streams as a replacement for queues
- The pytest plugin was refactored to run the test and all its related async fixtures inside the
same event loop, making async fixtures much more useful

- General changes/fixes:

- **BACKWARDS INCOMPATIBLE** Some functions have been renamed or removed (see further below for
socket/fileio API changes):

- ``finalize()`` → (removed; use ``async_generator.aclosing()`` instead)
- ``receive_signals()`` → ``open_signal_receiver()``
- ``run_in_thread()`` → ``run_sync_in_worker_thread()``
- ``current_default_thread_limiter()`` → ``current_default_worker_thread_limiter()``
- ``ResourceBusyError`` → ``BusyResourceError``
- **BACKWARDS INCOMPATIBLE** Exception classes were moved to the top level package
- Dropped support for Python 3.5
- Bumped minimum versions of trio and curio to v0.16 and v1.4, respectively
- Unified checkpoint behavior: a cancellation check now calls ``sleep(0)`` on asyncio and
curio, allowing the scheduler to switch to a different task
- Fixed a bug where a task group would abandon its subtasks if its own cancel scope was
cancelled while it was waiting for subtasks to finish
- Fixed recursive tracebacks when a single exception from an inner task group is reraised in an
outer task group
- The asyncio backend now uses ``asyncio.run()`` behind the scenes which properly shuts down
async generators and cancels any leftover native tasks
- Worked around curio's limitation where a task can only be cancelled twice (any cancellations
beyond that were ignored)
- **BACKWARDS INCOMPATIBLE** Removed the ``anyio.finalize()`` context manager since as of curio
1.0, it is no longer necessary. Use ``async_generator.aclosing()`` instead.
- **BACKWARDS INCOMPATIBLE** Renamed some functions and methods to match their corresponding
names in Trio:

- ``Stream.close()`` -> ``Stream.aclose()``
- ``AsyncFile.close()`` -> ``AsyncFile.aclose()``
- ``anyio.aopen()`` -> ``anyio.open_file()``
- ``anyio.receive_signals()`` -> ``anyio.open_signal_receiver()``
- ``anyio.run_in_thread()`` -> ``anyio.run_sync_in_worker_thread()``
- ``anyio.current_default_thread_limiter()`` -> ``anyio.current_default_worker_thread_limiter()``
- ``anyio.exceptions.ResourceBusyError`` -> ``anyio.BusyResourceError``
- **BACKWARDS INCOMPATIBLE** Exception classes were moved to the top level package
- Changed the ``repr()`` of ``ExceptionGroup`` to match trio's ``MultiError``

- Backend specific changes and fixes:

- ``asyncio``: Added support for ``ProactorEventLoop``. This allows asyncio applications to use
AnyIO on Windows even without using AnyIO as the entry point.
- ``asyncio``: The asyncio backend now uses ``asyncio.run()`` behind the scenes which properly
shuts down async generators and cancels any leftover native tasks
- ``curio``: Worked around the limitation where a task can only be cancelled twice (any
cancellations beyond that were ignored)
- ``asyncio`` + ``curio``: a cancellation check now calls ``sleep(0)``, allowing the scheduler to
switch to a different task
- ``asyncio`` + ``curio``: Host name resolution now uses `IDNA 2008`_ (with UTS 46 compatibility
mapping, just like trio)
- ``asyncio`` + ``curio``: Fixed a bug where a task group would abandon its subtasks if its own
cancel scope was cancelled while it was waiting for subtasks to finish
- ``asyncio`` + ``curio``: Fixed recursive tracebacks when a single exception from an inner task
group is reraised in an outer task group

- Socket/stream changes:

- **BACKWARDS INCOMPATIBLE** Renamed the ``max_size`` parameter to ``max_bytes`` wherever it
occurred (this was inconsistently named ``max_bytes`` in some subclasses before)
- **BACKWARDS INCOMPATIBLE** TLS functionality has been split off from ``SocketStream`` and can
now work over arbitrary streams – you can now establish a TLS encrypted communications pathway
using any bytes-based receive/send stream pair.
- ``connect_tcp()`` has been split into ``connect_tcp()`` and ``connect_tcp_with_tls()``
- **BACKWARDS INCOMPATIBLE** The stream class structure was completely overhauled. There are now
separate abstract base classes for receive and send streams, byte streams and reliable and
unreliable object streams. Stream wrappers are much better supported by this new ABC structure
and a new "typed extra attribute" system that lets you query the wrapper chain for the
attributes you want via ``.extra(...)``.
- **BACKWARDS INCOMPATIBLE** Socket server functionality has been refactored into a
network-agnostic listener system
- **BACKWARDS INCOMPATIBLE** The ``reuse_address`` option was replaced with ``reuse_port`` in
``create_udp_socket()``. This switches on the ``SO_REUSEPORT`` option. The ``SO_REUSEADDR`` is
no longer used under any circumstances with UDP sockets.
- Added the ``family`` attribute to socket streams and listeners (for getting the address family)
- **BACKWARDS INCOMPATIBLE** Removed the ``notify_socket_closing()`` function as it is no longer
used by AnyIO
- **BACKWARDS INCOMPATIBLE** TLS functionality has been split off from ``SocketStream`` and can
now work over any bidirectional bytes-based stream – you can now establish a TLS encrypted
communications pathway over UNIX sockets or even memory object streams. The ``TLSRequired``
exception has also been removed as it is no longer necessary.
- **BACKWARDS INCOMPATIBLE** Buffering functionality (``receive_until()`` and
``receive_exactly()``) was split off from ``SocketStream`` into a stream wrapper class
(``anyio.streams.buffered.BufferedByteReceiveStream``)
- **BACKWARDS INCOMPATIBLE** IPv6 addresses are now reported as 2-tuples. If original 4-tuple
form contains a nonzero scope ID, it is appended to the address with ``%`` as the separator.
- **BACKWARDS INCOMPATIBLE** Byte streams (including socket streams) now raise ``EndOfStream``
instead of returning an empty bytes object when the stream has been closed from the other end
- **BACKWARDS INCOMPATIBLE** The socket API has changes:

- ``create_tcp_server()`` → ``create_tcp_listener()``
- ``create_unix_server()`` → ``create_unix_listener()``
- ``create_udp_socket()`` had some of its parameters changed:

- ``interface`` → ``local_address``
- ``port`` → ``local_port``
- ``reuse_address`` was replaced with ``reuse_port`` (and sets ``SO_REUSEPORT`` instead of
``SO_REUSEADDR``)
- ``connect_tcp()`` had some of its parameters changed:

- ``address`` → ``remote_address``
- ``port`` → ``remote_port``
- ``bind_host`` → ``local_address``
- ``bind_port`` → (removed)
- ``autostart_tls`` → ``tls``
- ``tls_hostname`` (new parameter, when you want to match the certificate against against
something else than ``remote_address``)
- ``connect_tcp()`` now returns a ``TLSStream`` if TLS was enabled
- ``notify_socket_closing()`` was removed, as it is no longer used by AnyIO
- ``SocketStream`` has changes to its methods and attributes:

- ``address`` → ``.extra(SocketAttribute.local_address)``
- ``alpn_protocol`` → ``.extra(TLSAttribute.alpn_protocol)``
- ``close()`` → ``aclose()``
- ``get_channel_binding`` → ``.extra(TLSAttribute.channel_binding_tls_unique)``
- ``cipher`` → ``.extra(TLSAttribute.cipher)``
- ``getpeercert`` → ``.extra(SocketAttribute.peer_certificate)`` or
``.extra(SocketAttribute.peer_certificate_binary)``
- ``getsockopt()`` → ``.extra(SocketAttribute.raw_socket).getsockopt(...)``
- ``peer_address`` → ``.extra(SocketAttribute.remote_address)``
- ``receive_chunks()`` → (removed; use ``async for`` on the stream instead)
- ``receive_delimited_chunks()`` → (removed)
- ``receive_exactly()`` → ``BufferedReceiveStream.receive_exactly()``
- ``receive_some()`` → ``receive()``
- ``receive_until()`` → ``BufferedReceiveStream.receive_until()``
- ``send_all()`` → ``send()``
- ``setsockopt()`` → ``.extra(SocketAttribute.raw_socket).setsockopt(...)``
- ``shared_ciphers`` → ``.extra(TLSAttribute.shared_ciphers)``
- ``server_side`` → ``.extra(TLSAttribute.server_side)``
- ``start_tls()`` → ``stream = TLSStream.wrap(...)``
- ``tls_version`` → ``.extra(TLSAttribute.tls_version)``
- ``UDPSocket`` has changes to its methods and attributes:

- ``address`` → ``.extra(SocketAttribute.local_address)``
- ``getsockopt()`` → ``.extra(SocketAttribute.raw_socket).getsockopt(...)``
- ``port`` → ``.extra(SocketAttribute.local_port)``
- ``receive()`` no longer takes a maximum bytes argument
- ``receive_packets()`` → (removed; use ``async for`` on the UDP socket instead)
- ``send()`` → requires a tuple for destination now (address, port), for compatibility with
the new ``UnreliableObjectStream`` interface. The ``sendto()`` method works like the old
``send()`` method.
- ``setsockopt()`` → ``.extra(SocketAttribute.raw_socket).setsockopt(...)``
- **BACKWARDS INCOMPATIBLE** Renamed the ``max_size`` parameter to ``max_bytes`` wherever it
occurred (this was inconsistently named ``max_bytes`` in some subclasses before)
- Added memory object streams as a replacement for queues
- Added stream wrappers for encoding/decoding unicode strings
- Support for the ``SO_REUSEPORT`` option (allows binding more than one socket to the same
address/port combination, as long as they all have this option set) has been added to TCP
listeners and UDP sockets
- The ``send_eof()`` method was added to all (bidirectional) streams
- Added the ``raw_socket`` property on socket streams, UDP sockets and socket listeners

- File I/O changes:

- **BACKWARDS INCOMPATIBLE** Asynchronous file I/O functionality now uses a common code base
(``anyio.fileio.AsyncFile``) instead of backend-native classes
(``anyio.AsyncFile``) instead of backend-native classes
- **BACKWARDS INCOMPATIBLE** The File I/O API has changes to its functions and methods:

- ``aopen()`` → ``open_file()``
- ``AsyncFileclose()`` → ``AsyncFileaclose()``

- Task synchronization changes:

- **BACKWARDS INCOMPATIBLE** Queues were replaced by memory object streams
- **BACKWARDS INCOMPATIBLE** Added the ``acquire()`` and ``release()`` methods to the ``Lock``,
``Condition`` and ``Semaphore`` classes
- **BACKWARDS INCOMPATIBLE** Removed the ``Event.clear()`` method. You must now replace the event
object with a new one rather than clear the old one.
- **BACKWARDS INCOMPATIBLE** Removed the ``anyio.create_queue()`` function and the ``Queue``
class. Use memory object streams instead.
- Fixed ``Condition.wait()`` not working on asyncio and curio (PR by Matt Westcott)

- Testing changes:

- **BACKWARDS INCOMPATIBLE** Removed the ``--anyio-backends`` command line option for the pytest
plugin. Use the ``-k`` option to do ad-hoc filtering, and the ``anyio_backend`` fixture to
control which backends you wish to run the tests by default.
- The pytest plugin was refactored to run the test and all its related async fixtures inside the
same event loop, making async fixtures much more useful
- Fixed Hypothesis support in the pytest plugin (it was not actually running the Hypothesis
tests at all)

.. _IDNA 2008: https://tools.ietf.org/html/rfc5895

**1.4.0**

Expand Down

0 comments on commit 3e3f988

Please sign in to comment.