Skip to content

Commit

Permalink
Release v5.0.0, warning on older Python versions
Browse files Browse the repository at this point in the history
This prepares for a v6.0.0 version that breaks backwards compatibility
with older Python versions and potentially changes various internals.
  • Loading branch information
borntyping committed Apr 13, 2021
1 parent c981948 commit 2a9cfd1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build/*
dist/*
doc/*.log
MANIFEST
venv/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Sam Clements <sam@borntyping.co.uk>
Copyright (c) 2012-2021 Sam Clements <sam@borntyping.co.uk>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,31 @@ Log formatting with colors!
[![](https://img.shields.io/pypi/l/colorlog.svg)](https://pypi.org/project/colorlog/)
[![](https://img.shields.io/travis/borntyping/python-colorlog/master.svg)](https://travis-ci.org/borntyping/python-colorlog)

`colorlog.ColoredFormatter` is a formatter for use with Python's `logging`
module that outputs records using terminal colors.
Add colours to the output of Python's `logging` module.

* [Source on GitHub](https://github.com/borntyping/python-colorlog)
* [Packages on PyPI](https://pypi.org/pypi/colorlog/)
* [Builds on Travis CI](https://travis-ci.org/borntyping/python-colorlog)

Status
------

colorlog currently requires Python 3.5 or higher. Older versions (below 5.x.x)
support Python 2.6 and above.

* colorlog 6.x requires Python 3.5 or higher.
* colorlog 5.x is an interim version that will warn Python 2 users to downgrade.
* colorlog 4.x is the final version supporting Python 2.

[colorama] is included as a required dependency and initialised when using
colorlog on Windows.

This library is almost a decade old and supported a wide set of Python versions
for most of its life, which has made it a difficult library to add new features
to. colorlog 6 may break backwards compatibility so that newer features
can be added more easily, but may still not accept all changes or feature
requests. colorlog 4 might accept essential bugfixes but should not be
considered actively maintained and will not accept any major changes or new
features.

Installation
------------
Expand Down Expand Up @@ -173,14 +192,6 @@ logger.setLevel('TRACE')
logger.log(TRACE, 'a message using a custom level')
```

Compatibility
-------------

colorlog works on Python 2.6 and above, including Python 3.

On Windows, [colorama] is required for `colorlog` to work properly. It will
automatically be included when installing `colorlog` on windows.

Tests
-----

Expand All @@ -189,7 +200,7 @@ Tests similar to the above examples are found in `tests/test_colorlog.py`.
Status
------

colorlog is in maintainance mode. I try and ensure bugfixes are published,
colorlog is in maintenance mode. I try and ensure bugfixes are published,
but compatibility with Python 2.6+ and Python 3+ makes this a difficult
codebase to add features to. Any changes that might break backwards
compatibility for existing users will not be considered.
Expand All @@ -214,7 +225,7 @@ Projects using colorlog
Licence
-------

Copyright (c) 2012-2020 Sam Clements <sam@borntyping.co.uk>
Copyright (c) 2012-2021 Sam Clements <sam@borntyping.co.uk>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
10 changes: 10 additions & 0 deletions colorlog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

from __future__ import absolute_import

import sys
import warnings

from colorlog.colorlog import (
escape_codes,
default_log_colors,
Expand Down Expand Up @@ -43,3 +46,10 @@
"LevelFormatter",
"TTYColoredFormatter",
)

if sys.version_info > (3, 5):
warnings.warn(
"Colorlog 6.0.0 will require Python 3.5 or above. Pin 'colorlog<5' to your "
"dependencies if you require compatibility with older versions of Python. See "
"https://github.com/borntyping/python-colorlog#status for more information."
)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

setup(
name="colorlog",
version="4.8.0",
description="Log formatting with colors!",
version="5.0.0",
description="Add colours to the output of Python's logging module.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Sam Clements",
Expand Down

0 comments on commit 2a9cfd1

Please sign in to comment.