- Added ``asphalt.core.get_resources()`` as a top-level shortcut for
``current_context().get_resources(...)``
- Allowed resource retrieval and generation in teardown callbacks until the context has
been completely closed (this would previously raise
``RuntimeError("this context has already been closed")``)
- Allowed specifying optional dependencies with dependency injection, using either
``Optional[SomeType]`` (all Python versions) or ``SomeType | None`` (Python 3.10+)
- Allowed omitting the ``types`` argument in ``Context.add_resource_factory()`` if the
factory callable has a return type annotation
- ``Context.call_in_executor()`` now copies the current `PEP 567`_ context to the worker
thread, allowing operations that require the "current context" to be present (e.g.
dependency injection)
- Raise better errors when the developer forgets to call ``resource()`` or forgets to
add the ``inject`` decorator
- Raise a ``UserWarning`` when ``inject`` is used on a function that has no
``resource()`` declarations
- Fixed ``inject`` not resolving forward references in type annotations in locally
defined functions
- Improved type annotations
.. _PEP 567: https://peps.python.org/pep-0567/