Mode

Latest version: v4.4.0

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

Scan your dependencies

Page 5 of 15

3.0.13

======
:release-date: 2019-03-20 04:58 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Adds ``CompositeLogger.warning`` alias to ``warn``.

:pypi:`flake8-logging-format` has a rule that says
you are only allowed to use ``.warning``, so going with that.

.. _version-3.0.12:

3.0.12

======
:release-date: 2019-03-20 03:23 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Adds :func:`~mode.utils.futures.all_tasks` as a backward compatible
:func:`asyncio.all_tasks`.

- Signal: Fixes ``.connect()`` decorator to work with parens and without

Signal decorator now works with parens:

.. sourcecode:: python

signal.connect()
def my_handler(sender, **kwargs):
...

and without parens:

.. sourcecode:: python

signal.connect
def my_handler(sender, **kwargs):
...

- Signal: Do not use weakref by default.

Using weakref by default meant it was too easy to connect
a signal handler to only have it disappear because there were
no more references to the object.

.. _version-3.0.11:

3.0.11

======
:release-date: 2019-03-19 08:50 A.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Adds ThrowableQueue._throw() for non-async version of .throw().

.. _version-3.0.10:

3.0.10

======
:release-date: 2019-03-14 03:55 P.M PST
:release-by: Ask Solem (:github_user:`ask`)

- Worker: was giving successful exit code when an exception is raised.

The ``.execute_from_commandline`` method now always exits
(its return type is :class:`typing.NoReturn`).

- Adds :class:`~mode.utils.compat.NoReturn` to :mod:`mode.utils.compat`.

Import :class:`typing.NoReturn` from here to support Python versions
before 3.6.3.

.. _version-3.0.9:

3.0.9

=====
:release-date: 2019-03-08 01:20 P.M PDT
:release-by: Ask Solem (:github_user:`ask`)

- Threads: Add multiple workers for thread method queue.

Default number of workers is now 2, to allow for
two recursive calls.

- Signal: Use `Signal.label` instead of ``.indent`` to be more consistent.

- Signal: Properly set ``.name`` when signal is member of class.

- Adds ability to log the FULL traceback of :class:`asyncio.Task`.

- Service: Stop faster if stopped immediately after start

- Service: Correctly track dependencies for services added
using ``Service.on_init_dependencies`` (Issue 40).

Contributed by Nimi Wariboko Jr (:github_user:`nemosupremo`).

.. _version-3.0.8:

3.0.8

=====
:release-date: 2019-01-25 03:54 P.M PDT
:release-by: Ask Solem (:github_user:`ask`)

- Fixes ``DeprecationWarning`` importing from ``collections``.

- stampede: Fixed edge case where stampede wrapped function
called multiple times.

Calling the same stampede wrapped function multiple times
within the same event loop iteration would previously call
the function multiple times.

For example using :func:`asyncio.gather`:

.. sourcecode:: python

from mode.utils.futures import stampede

count = 0
stampede
async def update_count():
global count
count += 1

async def main():
await asyncio.gather(
update_count(),
update_count(),
update_count(),
update_count(),
)

assert count == 1

Previously this would call the function four times, but with the
fix it's only called once and provides the expected result.

- Mocks: Adds :func:`~mode.utils.mocks.mask_module` and
:func:`~mode.utils.mocks.patch_module`.

- CI: Added Windows build.

- CI: Enabled random order for tests.


.. _version-3.0.7:

Page 5 of 15

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.