From 036faef9fde9421aabb01d6e7f48d34c6bbdc359 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 15 Feb 2020 19:06:19 +0200 Subject: [PATCH 1/4] Drop support for EOL Python 3.4 --- .travis.yml | 2 -- README.rst | 2 +- setup.py | 3 +-- tox.ini | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a331c1a..90bbb80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,6 @@ matrix: language: generic - os: linux python: "2.7" - - os: linux - python: "3.4" - os: linux python: "3.5" - os: linux diff --git a/README.rst b/README.rst index ed4be69..0968144 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ The `coloredlogs` package enables colored terminal output for Python's logging_ module. The ColoredFormatter_ class inherits from `logging.Formatter`_ and uses `ANSI escape sequences`_ to render your logging messages in color. It uses only standard colors so it should work on any UNIX terminal. It's currently tested -on Python 2.7, 3.4+ and PyPy. On Windows `coloredlogs` +on Python 2.7, 3.5+ and PyPy. On Windows `coloredlogs` automatically pulls in Colorama_ as a dependency and enables ANSI escape sequence translation using Colorama. Here is a screen shot of the demo that is printed when the command ``coloredlogs --demo`` is executed: diff --git a/setup.py b/setup.py index ebf03d7..2aad357 100755 --- a/setup.py +++ b/setup.py @@ -136,7 +136,7 @@ def find_pth_directory(): install_requires=get_install_requires(), extras_require=get_extras_require(), tests_require=get_requirements('requirements-tests.txt'), - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -152,7 +152,6 @@ def find_pth_directory(): 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', diff --git a/tox.ini b/tox.ini index 5274fec..07bd505 100644 --- a/tox.ini +++ b/tox.ini @@ -4,11 +4,11 @@ # directory. [tox] -envlist = py27, py34, py35, py36, py37, py38, py39, pypy +envlist = py27, py35, py36, py37, py38, py39, pypy [testenv] deps = -rrequirements-tests.txt -commands = py.test {posargs} +commands = pytest {posargs} [pytest] addopts = --verbose From dfc1b805ebb0dcb9f34b36da4b3e50143fe995e4 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sat, 15 Feb 2020 23:26:51 +0100 Subject: [PATCH 2/4] Improve compatibility of ColoredFormatter initializer arguments (#64, #75) This is backwards incompatible with callers using positional arguments to call ColoredFormatter.__init__() however it improves compatibility with the Python standard library. --- coloredlogs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coloredlogs/__init__.py b/coloredlogs/__init__.py index 58b5e66..2cb215b 100644 --- a/coloredlogs/__init__.py +++ b/coloredlogs/__init__.py @@ -992,7 +992,7 @@ class ColoredFormatter(BasicFormatter): when you call :func:`coloredlogs.install()`. """ - def __init__(self, fmt=None, datefmt=None, level_styles=None, field_styles=None, style=DEFAULT_FORMAT_STYLE): + def __init__(self, fmt=None, datefmt=None, style=DEFAULT_FORMAT_STYLE, level_styles=None, field_styles=None): """ Initialize a :class:`ColoredFormatter` object. From bba76aec0917634186b0271bc7f31d31ddbbc874 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sun, 16 Feb 2020 00:21:21 +0100 Subject: [PATCH 3/4] Stop using 'imp' module (deprecation warning) --- coloredlogs/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coloredlogs/tests.py b/coloredlogs/tests.py index 6e6dbe5..ff0920e 100644 --- a/coloredlogs/tests.py +++ b/coloredlogs/tests.py @@ -1,14 +1,13 @@ # Automated tests for the `coloredlogs' package. # # Author: Peter Odding -# Last Change: February 15, 2020 +# Last Change: February 16, 2020 # URL: https://coloredlogs.readthedocs.io """Automated tests for the `coloredlogs` package.""" # Standard library modules. import contextlib -import imp import logging import logging.handlers import os @@ -16,6 +15,7 @@ import subprocess import sys import tempfile +import types # External dependencies. from humanfriendly.compat import StringIO @@ -615,7 +615,7 @@ def mocked_colorama_module(init_function): """Context manager to ease testing of colorama integration.""" module_name = 'colorama' # Create a fake module shadowing colorama. - fake_module = imp.new_module(module_name) + fake_module = types.ModuleType(module_name) setattr(fake_module, 'init', init_function) # Temporarily reconfigure coloredlogs to use colorama. need_colorama = coloredlogs.NEED_COLORAMA From da44a69aad90fd552691c5d61c5f9edc57fe1d6e Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sun, 16 Feb 2020 00:35:15 +0100 Subject: [PATCH 4/4] Release 12.0: Improve stdlib compat, drop Python 3.4 (#64, #75, #80) --- CHANGELOG.rst | 20 +++++++++++++++++++- coloredlogs/__init__.py | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d56725c..c300b9b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,11 +11,29 @@ to `semantic versioning`_. .. _Keep a Changelog: http://keepachangelog.com/ .. _semantic versioning: http://semver.org/ +`Release 12.0`_ (2020-02-16) +---------------------------- + +Two backwards incompatible changes prompted another major version bump: + +- Merged pull request `#80`_ that drops support for Python 3.4 which + has gone end-of-life and now represents less than 1% of PyPI downloads. + +- Improved compatibility with the Python standard library by changing + the order of positional arguments received by the initializer of the + :class:`~coloredlogs.ColoredFormatter` class (as suggested in `#64`_ + and `#75`_). + +.. _Release 12.0: https://github.com/xolox/python-coloredlogs/compare/11.3...12.0 +.. _#80: https://github.com/xolox/python-coloredlogs/pull/80 +.. _#64: https://github.com/xolox/python-coloredlogs/issues/64 +.. _#75: https://github.com/xolox/python-coloredlogs/issues/75 + `Release 11.3`_ (2020-02-15) ---------------------------- - Add support for the ``%(username)s`` field (requested in `#76`_) and properly - document the supported custom fields in the readme. + document supported custom fields. - Consistently use ``console`` highlighting in documentation. diff --git a/coloredlogs/__init__.py b/coloredlogs/__init__.py index 2cb215b..5b947df 100644 --- a/coloredlogs/__init__.py +++ b/coloredlogs/__init__.py @@ -1,7 +1,7 @@ # Colored terminal output for Python's logging module. # # Author: Peter Odding -# Last Change: February 15, 2020 +# Last Change: February 16, 2020 # URL: https://coloredlogs.readthedocs.io """ @@ -213,7 +213,7 @@ NEED_COLORAMA = WINDOWS # Semi-standard module versioning. -__version__ = '11.3' +__version__ = '12.0' DEFAULT_LOG_LEVEL = logging.INFO """The default log level for :mod:`coloredlogs` (:data:`logging.INFO`)."""