Asphalt

Latest version: v4.11.1

Safety actively analyzes 714772 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

4.0.0

- **BACKWARD INCOMPATIBLE** When a teardown callback raises an exception during
``Context.close()``, a ``TeardownException`` is raised at the end instead of the error being
logged
- Renamed the ``asphalt.core.command`` module to ``asphalt.core.cli``
- Fixed the inability to override the component type from external configuration
(contributed by Devin Fee)

3.0.2

- Fixed ``CLIApplicationComponent`` running prematurely (during the application start phase) and
skipping the proper shutdown sequence
- Fixed return code from ``CLIApplicationComponent`` being ignored

3.0.1

- Fixed ``run_application()`` not working on Windows due to ``NotImplementedError`` when adding the
``SIGTERM`` signal handler

3.0.0

- **BACKWARD INCOMPATIBLE** Upped the minimum Python version to 3.5.2 from 3.5.0
- **BACKWARD INCOMPATIBLE** Renamed the ``asphalt.core.util`` module to ``asphalt.core.utils``
- The ``asphalt.core.event`` module was overhauled:

- **BACKWARD INCOMPATIBLE** Removed the ``monotime`` attribute from the ``Event`` class
- **BACKWARD INCOMPATIBLE** Dropped the ``return_future`` argument from ``Signal.dispatch()``
and ``Signal.dispatch_event()`` – they now always return an awaitable that resolves to a
boolean, indicating whether all callbacks were successful or not
- **BACKWARD INCOMPATIBLE** Made the ``max_queue_size`` argument in ``Signal.stream_events`` and
``stream_events()`` into a keyword-only argument
- **BACKWARD INCOMPATIBLE** ``Signal.dispatch_event()`` was renamed to ``Signal.dispatch_raw()``
- Added the ``filter`` argument to ``Signal.stream_events()`` and ``stream_events()`` which can
restrict the events that are yielded by them
- Added the ``time`` constructor argument to the ``Event`` class
- The ``asphalt.core.context`` module was overhauled:

- "lazy resources" are now called "resource factories"
- ``Context.get_resources()`` now returns a set of ``ResourceContainer`` (instead of a list)
- **BACKWARD INCOMPATIBLE** The ``default_timeout`` parameter was removed from the ``Context``
constructor
- **BACKWARD INCOMPATIBLE** The ``timeout`` parameter of ``Context.request_resource()`` was
removed
- **BACKWARD INCOMPATIBLE** The ``alias`` parameter of ``Context.request_resource()`` was
renamed to ``name``
- **BACKWARD INCOMPATIBLE** Removed the ``Context.finished`` signal in favor of the new
``add_teardown_callback()`` method which has different semantics (callbacks are called in LIFO
order and awaited for one at a time)
- **BACKWARD INCOMPATIBLE** Removed the ability to remove resources from a ``Context``
- Added several new methods to the ``Context`` class: ``close()``, ``get_resource()``,
``require_resource()``
- **BACKWARD INCOMPATIBLE** ``Context.publish_resource()`` was renamed to
``Context.add_resource()``
- **BACKWARD INCOMPATIBLE** ``Context.publish_lazy_resource()`` was renamed to
``Context.add_resource_factory()``
- **BACKWARD INCOMPATIBLE** The ``Context.get_resources()`` method was removed until
it can be replaced with a better thought out API
- **BACKWARD INCOMPATIBLE** The ``Resource`` class was removed from the public API
- Three new methods were added to the ``Context`` class to bridge ``asyncio_extras`` and
``Executor`` resources: ``call_async()``, ``call_in_executor()`` and ``threadpool()``
- Added a new decorator, ``executor`` to help run code in specific ``Executor`` resources
- The application runner (``asphalt.core.runner``) got some changes too:

- **BACKWARD INCOMPATIBLE** The runner no longer cancels all active tasks on exit
- **BACKWARD INCOMPATIBLE** There is now a (configurable, defaults to 5 seconds) timeout for
waiting for the root component to start
- Asynchronous generators are now closed after the context has been closed (on Python 3.6+)
- The SIGTERM signal now cleanly shuts down the application
- Switched from ``asyncio_extras`` to ``async_generator`` as the async generator compatibility
library
- Made the current event loop accessible (from any thread) as the ``loop`` property from any
``asphalt.core.context.Context`` instance to make it easier to schedule execution of async code
from worker threads
- The ``asphalt.core.utils.merge_config()`` function now accepts ``None`` as either argument
(or both)

2.1.1

- Fixed memory leak which prevented objects containing Signals from being garbage collected
- Log a message on startup that indicates whether optimizations (``-O`` or ``PYTHONOPTIMIZE``) are
enabled

2.1.0

- Added the possibility to specify more than one configuration file on the command line
- Added the possibility to use the command line interface via ``python -m asphalt ...``
- Added the ``CLIApplicationComponent`` class to facilitate the creation of Asphalt based command
line tools
- Root component construction is now done after installing any alternate event loop policy provider
- Switched YAML library from PyYAML to ruamel.yaml
- Fixed a corner case where in ``wait_event()`` the future's result would be set twice, causing an
exception in the listener
- Fixed coroutine-based lazy resource returning a CoroWrapper instead of a Future when asyncio's
debug mode has been enabled
- Fixed a bug where a lazy resource would not be created separately for a context if a parent
context contained an instance of the same resource

Page 4 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.