Mode

Latest version: v4.4.0

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

Scan your dependencies

Page 3 of 15

4.1.2

=====
:release-date: 2019-10-02 3:41 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Adds easy flight recorder interface.

Instead of passing flight recorders around, we now have the concept
of a ``current_flight_recorder``.

There is also a new ``on_timeout`` wrapper object that always
logs to the current flight recorder:

.. sourcecode:: python

from mode.utils.logging import flight_recorder, on_timeout

async def main():
with flight_recorder(logger, timeout=300):
some_function()

def some_function():
on_timeout.error('Fetching data')
fetch_data()

on_timeout.error('Processing data')
process_data()

This uses a :class:`~mode.utils.locals.LocalStack`,
so flight recorders can be arbitrarily nested.
Once a flight recorder context exits, the previously active flight
recorder will be set active again.

- Logging: Default logging format now includes process PID.

- Adds :class:`~mode.utils.collections.Heap` as generic interface
to the heapq module

.. _version-4.1.1:

4.1.1

=====
:release-date: 2019-10-02 3:41 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- ``is_optional``: Now works with union having multiple args on Python 3.6.

- ``Proxy``: Due to `Python issue 29581`_ the ``source`` class option
to :class:`~mode.locals.Proxy` cannot be used on Python 3.6.

To work around this when support for 3.6 is a requirement
you can now use a ``__proxy_source__`` class attribute instead:

.. sourcecode:: python

class MappingProxy(Proxy[Mapping]):
proxy_source__ = Mapping

you want to support 3.7 and up you can continue to use the class syntax:

.. sourcecode:: python

class MappingProxy(Proxy[Mapping], source=Mapping):
...

.. _`Python issue 29581`: https://bugs.python.org/issue29581

.. _version-4.1.0:

4.1.0

=====
:release-date: 2019-09-27 2:00 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Worker: Adds ``override_logging`` option to use your own logging
setup (Issue 46).

- Service: Adds ``Service.crash_reason`` (Issue 50).

- Service: Adds ``remove_dependency`` to disable dependencies at runtime
(Issue 49).

Contributed by Martin Maillard.

- Timers: Increase max drift to silence noisy logs.

- Proxy: Adds support for lazy proxying of objects.

See :mod:`mode.locals`.

- Documentation improvements by:

+ :github_user:`tojkamaster`.

+ :github_user:`casio`

.. _version-4.0.1:

4.0.1

=====
:release-date: 2019-07-17 3:42 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Utils: :class:`~mode.utils.future.stampede` objects can now be
read by :pypi:`Sphinx` and :func:`inspect.signature`.

- CI: Adds CPython 3.7.3 to build matrix, and set as default for lint stages

.. _version-4.0.0:

4.0.0

=====
:release-date: 2019-05-07 2:21 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- 100% Test Coverage

- Fixed several edge case bugs that were never reported.

.. _version-3.2.2:

3.2.2

=====
:release-date: 2019-04-07 6:18 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- :class:`~mode.utils.typing.AsyncGenerator` takes two arguments.

Mistakenly had it take three arguments, like :class:`typing.Generator`.S

.. _version-3.2.1:

Page 3 of 15

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.