Humanfriendly

Latest version: v10.0

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

Scan your dependencies

Page 2 of 23

8.0

---------------------------

This release is backwards incompatible in several ways, see the notes below.

**Enhancements:**

- Adopt :func:`functools.wraps()` to make decorator functions more robust.

- Make the :class:`~humanfriendly.terminal.spinners.Spinner` class more
customizable. The interval at which spinners are updated and the characters
used to draw the animation of spinners can now be customized by callers.
This was triggered by `executor issue 2`_.

.. note:: The text cursor hiding behavior of spinners has been removed
because it was found to be problematic (sometimes the text cursor
would be hidden but not made visible again, which is disorienting
to say the least).

- Improve test skipping based on exception types.

The :class:`humanfriendly.testing.TestCase` class was originally created to
enable skipping of tests that raise specific exception types on Python 2.6.
This involved patching test methods, which had the unfortunate side effect
of generating confusing :pypi:`pytest` output on test failures.

Since then :pypi:`unittest2` was integrated which provided real
skipping of tests however removing the old test skipping support
from the :mod:`humanfriendly.testing` module would have resulted
in a backwards incompatible change, so I never bothered. I've now
decided to bite the bullet and get this over with:

1. I've implemented an alternative (finer grained) strategy based on a
decorator function that applies to individual test methods, for
details see :func:`humanfriendly.testing.skip_on_raise()`.

2. I've removed the test method wrapping from the
:class:`humanfriendly.testing.TestCase` class.

.. note:: This change is backwards incompatible, in fact it breaks the
test suites of two other projects of mine (:pypi:`executor` and
:pypi:`vcs-repo-mgr`) because they depend on the old test method
wrapping approach. Both test suites will need to be migrated to
the :func:`~humanfriendly.testing.skip_on_raise()` decorator.

**Internal changes:**

- The "deprecated imports" feature provided by :mod:`humanfriendly.deprecation`
has been adopted to clean up the maze of (almost but not quite) cyclic import
dependencies between modules.

- HTML to ANSI functionality has been extracted to a new
:mod:`humanfriendly.terminal.html` module.

- Support for spinners has been extracted to a new
:mod:`humanfriendly.terminal.spinners` module.

- The use of positional arguments to initialize
:class:`~humanfriendly.terminal.spinners.Spinner` objects has been deprecated
using the new :func:`humanfriendly.deprecation.deprecated_args()` decorator
function.

.. _Release 8.0: https://github.com/xolox/python-humanfriendly/compare/7.3...8.0
.. _executor issue 2: https://github.com/xolox/python-executor/issues/2

7.3

---------------------------

**Enhancements:**

Added the :func:`humanfriendly.deprecation.deprecated_args()` decorator function
which makes it easy to switch from positional arguments to keyword arguments
without dropping backwards compatibility.

.. note:: I'm still working on the humanfriendly 8.0 release which was going to
break backwards compatibility in several ways if it wasn't for the
tools provided by the new :mod:`humanfriendly.deprecation` module.

.. _Release 7.3: https://github.com/xolox/python-humanfriendly/compare/7.2...7.3

7.2

---------------------------

**Enhancements:**

Support for backwards compatible aliases that emit deprecation warnings
(:mod:`humanfriendly.deprecation`).

.. note:: I'm currently working on several large refactorings that involve
moving things around between modules and dreaded having to extend the
existing maze of (almost but not quite) cyclic import dependencies
between modules. This new functionality will be adopted to untangle
the existing maze in the upcoming humanfriendly 8.0 release, which
bumps the major version number due to this very large change in how
backwards compatibility is implemented. It is my hope that this new
functionality will prove to be robust enough to unburden me from the
less elegant aspects of preserving backwards compatibility 😁.

**Documentation:**

Get rid of broken references and noise in the online documentation once and for all:

- :pypi:`Sphinx` was emitting a screen full of warnings about unknown
references. These were bothering me because testing the integration between
Sphinx and :mod:`humanfriendly.deprecation` involved lots of broken
references as well.

- Additionally the :mod:`humanfriendly.compat` module introduced a lot of noise
into the generated documentation because imported classes and their members
were being included in the documentation, this is now also fixed.

- Finally I decided to start using ``sphinx-build -nW`` to complain loudly when
even just one broken reference is found. This should encourage the discipline
to never introduce broken references again!

**Tests:**

Fixed :mod:`unittest` deprecation warnings in the test suite.

.. _Release 7.2: https://github.com/xolox/python-humanfriendly/compare/7.1.1...7.2

7.1.1

-----------------------------

Fix Python 3 incompatibility (``distutils.spawn``).

Much to my dismay this morning I ran into the following traceback on a Python

7.1

---------------------------

**Enhancements:**

- Enable Windows native support for ANSI escape sequences. This was brought to
my attention in `coloredlogs issue 71`_ and `coloredlogs pull request 72`_.
My experiences with ANSI escape sequences started out as part of the
:pypi:`coloredlogs` package but eventually I moved the support for ANSI
escape sequences to the :pypi:`humanfriendly` package. This explains how it
now makes sense to integrate the Windows native ANSI escape sequence support
in :pypi:`humanfriendly` as well.

**Bug fixes:**

- Accept pluralized disk size units (`26`_). I'm not claiming this is a full
solution to the problem, far from it. It does lessen the pain a bit (IMHO).

- Make sure the selected pager is available before trying to run it. While
testing :pypi:`humanfriendly` on Windows 10 I noticed that ``humanfriendly
--help`` resulted in nothing but a traceback, because :man:`less` wasn't
available. That's not human friendly at all 😕 (even if it is Windows 😈).

.. _Release 7.1: https://github.com/xolox/python-humanfriendly/compare/7.0...7.1
.. _coloredlogs issue 71: https://github.com/xolox/python-coloredlogs/issues/71
.. _coloredlogs pull request 72: https://github.com/xolox/python-coloredlogs/pull/72
.. _26: https://github.com/xolox/python-humanfriendly/issues/26

7.0

---------------------------

After an unplanned but extended hiatus from the development and maintenance of
my open source projects I'm now finally starting to pick up some momentum, so
I'm trying to make the best of it:

- Merge pull request `24`_: Fix bug in :func:`~humanfriendly.parse_length()` that rounded floats.
- Merge pull request `32`_: Update hyperlinks in readme.
- Merge pull request `33`_: Drop support for Python 2.6 and 3.0-3.4
- Merge pull request `35`_: SVG badge in readme.
- Merge pull request `36`_: Add support for nanoseconds and microseconds time units
- Fixed :func:`~humanfriendly.tables.format_rst_table()` omission from
``humanfriendly.tables.__all__``.
- Start testing on Python 3.8 and 3.9-dev.

.. _Release 7.0: https://github.com/xolox/python-humanfriendly/compare/6.1...7.0
.. _24: https://github.com/xolox/python-humanfriendly/pull/24
.. _32: https://github.com/xolox/python-humanfriendly/pull/32
.. _33: https://github.com/xolox/python-humanfriendly/pull/33
.. _35: https://github.com/xolox/python-humanfriendly/pull/35
.. _36: https://github.com/xolox/python-humanfriendly/pull/36

Page 2 of 23

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.