Skip to content

Commit 065f068

Browse files
committed
Merge branch 'master' into pr137
2 parents 6a09094 + 1368087 commit 065f068

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1274
-365
lines changed

.github/FUNDING.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# These are supported funding model platforms
2+
3+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
4+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
5+
# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
6+
# issuehunt: # Replace with a single IssueHunt username
7+
# ko_fi: # Replace with a single Ko-fi username
8+
# liberapay: # Replace with a single Liberapay username
9+
# open_collective: # Replace with a single Open Collective username
10+
# otechie: # Replace with a single Otechie username
11+
# patreon: # Replace with a single Patreon username
12+
custom: ["https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2MZ9D2GMLYCUJ&item_name=Colorama&currency_code=USD"]
13+
tidelift: "pypi/colorama"
14+

.github/workflows/lint_python.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint_python
2+
on: [pull_request, push]
3+
jobs:
4+
lint_python:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v2
9+
- run: pip install --upgrade pip wheel
10+
- run: pip install bandit black codespell flake8 flake8-bugbear
11+
flake8-comprehensions isort mypy pytest pyupgrade safety
12+
- run: bandit --recursive --skip B311 .
13+
- run: black --check . || true
14+
- run: codespell # --ignore-words-list="" --skip="*.css,*.js,*.lock"
15+
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
16+
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88
17+
--show-source --statistics
18+
- run: isort --check-only --profile black . || true
19+
- run: pip install -r requirements.txt
20+
- run: mkdir --parents --verbose .mypy_cache
21+
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
22+
- run: pytest .
23+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
24+
- run: safety check

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Test
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
env:
6+
FORCE_COLOR: 1
7+
8+
jobs:
9+
test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["pypy-2.7", "pypy-3.8", "2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
include:
17+
# Add new helper variables to existing jobs
18+
- {python-version: "pypy-2.7", toxenv: "pypy"}
19+
- {python-version: "pypy-3.8", toxenv: "pypy3"}
20+
- {python-version: "2.7", toxenv: "py27"}
21+
- {python-version: "3.7", toxenv: "py37"}
22+
- {python-version: "3.8", toxenv: "py38"}
23+
- {python-version: "3.9", toxenv: "py39"}
24+
- {python-version: "3.10", toxenv: "py310"}
25+
- {python-version: "3.11", toxenv: "py311"}
26+
- {python-version: "3.12", toxenv: "py312"}
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
allow-prereleases: true
36+
37+
- name: Get pip cache dir
38+
id: pip-cache
39+
run: |
40+
echo "::set-output name=dir::$(pip cache dir)"
41+
42+
- name: Cache
43+
uses: actions/cache@v3
44+
with:
45+
path: ${{ steps.pip-cache.outputs.dir }}
46+
key:
47+
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/tox.ini') }}
48+
restore-keys: |
49+
${{ matrix.os }}-${{ matrix.python-version }}-v1-
50+
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install tox
54+
55+
- name: Tox tests
56+
run: |
57+
tox -e ${{ matrix.toxenv }}

.gitignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
*.pyc
22
*.egg-info
3-
MANIFEST
4-
dist
5-
tags
3+
.coverage
4+
.tox/
5+
/MANIFEST
6+
/build/
7+
/dist/
8+
/sandbox/
9+
/tags
610
virtualenv
7-
build
811

912
# PyCharm
10-
.idea
13+
.idea

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,66 @@
1+
0.4.6 Current release
2+
* https://github.com/tartley/colorama/pull/139 Add alternative to 'init()',
3+
called 'just_fix_windows_console'. This fixes many longstanding problems
4+
with 'init', such as working incorrectly on modern Windows terminals, and
5+
wonkiness when init gets called multiple times. The intention is that it
6+
just makes all Windows terminals treat ANSI the same way as other terminals
7+
do. Many thanks the njsmith for fixing our messes.
8+
* https://github.com/tartley/colorama/pull/352 Support Windows 10's ANSI/VT
9+
console. This didn't exist when Colorama was created, and avoiding us
10+
causing havok there is long overdue. Thanks to segeviner for the initial
11+
approach, and to njsmith for getting it merged.
12+
* https://github.com/tartley/colorama/pull/338 Internal overhaul of package
13+
metadata declaration, which abolishes our use of the now heavily
14+
discouraged setuptools (and hence setup.py, setup.cfg and MANIFEST.in), in
15+
favor of hatchling (and hence pyproject.toml), generously contributed by
16+
ofek (author of hatchling). This includes dropping support Python3.5 and
17+
3.6, which are EOL, and were already dropped from setuptools, so this
18+
should not affect our users.
19+
* https://github.com/tartley/colorama/pull/353 Attention to detail award to
20+
LqdBcnAtWork for a spelling fix in demo06
21+
0.4.5
22+
* Catch a racy ValueError that could occur on exit.
23+
* Create README-hacking.md, for Colorama contributors.
24+
* Tweak some README unicode characters that don't render correctly on PyPI.
25+
* Fix some tests that were failing on some operating systems.
26+
* Add support for Python 3.9.
27+
* Add support for PyPy3.
28+
* Add support for pickling with the ``dill`` module.
29+
0.4.4
30+
* Re-org of README, to put the most insteresting parts near the top.
31+
* Added Linux makefile targets and Windows powershell scripts to automate
32+
bootstrapping a development environment, and automate the process of
33+
testing wheels before they are uploaded to PyPI.
34+
* Use stdlib unittest.mock where available
35+
* Travis CI now also builds on arm64
36+
* Demo06 demonstrates existing cursor positioning feature
37+
* Fix OSC regex & handling to prevent hang or crash
38+
* Document enterprise support by Tidelift
39+
0.4.3
40+
* Fix release 0.4.2 which was uploaded with missing files.
41+
0.4.2 BROKEN DO NOT USE
42+
* #228: Drop support for EOL Python 3.4, and add 3.7 and 3.8. Thanks to
43+
hugovk.
44+
* Several additions and fixes to documentation and metadata.
45+
* Added Tidelift subscription information.
46+
0.4.1
47+
* Fix issue #196: prevent exponential number of calls when calling 'init'
48+
multiple times. Reported by bbayles and fixed by Delgan.
49+
0.4.0
50+
* Fix issue #142: reset LIGHT_EX colors with RESET_ALL. Reported by Delgan
51+
* Fix issue #147: ignore invalid "erase" ANSI codes. Reported by shin-
52+
* Fix issues #163 and #164: fix stream wrapping under PyCharm. Contributed by
53+
veleek and Delgan.
54+
* Thanks to jdufresne for various code cleanup and updates to documentation
55+
and project metadata. (pull requests #171, #172, #173, #174, #176, #177,
56+
#189, #190, #192)
57+
* #186: added contextlib magic methods to ansitowin32.StreamWrapper.
58+
Contributed by hoefling.
59+
* Fix issue #131: don't cache stdio handles, since they might be
60+
closed/changed by fd redirection. This fixes an issue with pytest.
61+
Contributed by segevfiner.
62+
* #146, #157: Drop support for EOL Python 2.5, 2.6, 3.1, 3.2 and 3.3, and add
63+
3.6. Thanks to hugovk.
164
0.3.9
265
* Revert fix for issue #103 which causes problems for dependent applications
366
0.3.8
@@ -16,11 +79,11 @@
1679
* Fix issue #47 and #80 - stream redirection now strips ANSI codes on Linux
1780
* Fix issue #53 - strip readline markers
1881
* Fix issue #32 - assign orig_stdout and orig_stderr when initialising
19-
* Fix issue #57 - Fore.RESET did not reset style of LIGHT_EX colors.
20-
Fixed by Andy Neff
82+
* Fix issue #57 - Fore.RESET did not reset style of LIGHT_EX colors. Fixed by
83+
Andy Neff
2184
* Fix issue #51 - add context manager syntax. Thanks to Matt Olsen.
22-
* Fix issue #48 - colorama didn't work on Windows when environment
23-
variable 'TERM' was set.
85+
* Fix issue #48 - colorama didn't work on Windows when environment variable
86+
'TERM' was set.
2487
* Fix issue #54 - fix pylint errors in client code.
2588
* Changes to readme and other improvements by Marc Abramowitz and Zearin
2689
0.3.3
@@ -42,17 +105,17 @@
42105
* Thanks to Charles Merriam for adding documentation to demos
43106
0.3.2
44107
* Thanks to Marc Schlaich (schlamar) for a setup.py fix for Python2.5
45-
* Thanks to Jurko for fix on 64-bit Windows CPython2.5 w/o ctypes
46-
(Google Code issue #56)
108+
* Thanks to Jurko for fix on 64-bit Windows CPython2.5 w/o ctypes (Google
109+
Code issue #56)
47110
* Thanks to Remi Rampin for:
48111
* better github integration, incl rendered README and Travis config.
49112
* fixed forward slashes in README
50113
* Thanks to Florian Bruhin for fix when stdout or stderr are None
51114
* Thanks to Simeon Visser for:
52115
* closing a file handle using 'with'
53116
* updating classifiers to include Python 3.3 and 3.4
54-
* Thanks to Thomas Weininger for fix ValueError on Windows
55-
(Google Code issue #50)
117+
* Thanks to Thomas Weininger for fix ValueError on Windows (Google Code issue
118+
#50)
56119
0.3.1
57120
* Fixed crash on exit with closed stdout, with thanks to Marc Abramowitz.
58121
* Now uses setuptools if available, and falls back to distutils if not.
@@ -64,15 +127,14 @@
64127
* Fix always-crash on non-Windows platforms, reported by Matt McCormick.
65128
* Fix Google Code issue #47, incompatible with pyreadline.
66129
0.2.7
67-
* Fix problem under 64-bit windows due to ctypes HANDLE size.
68-
Submitted by the rather magnificent Ben Hoyt.
69-
This fixes Google Code issue #43
130+
* Fix problem under 64-bit windows due to ctypes HANDLE size. Submitted by
131+
the rather magnificent Ben Hoyt. This fixes Google Code issue #43
70132
0.2.6
71133
* Add copyright & licensing info to every file, as requested by a large
72134
downstream project which has problems making sure that all 3rd party
73135
contributions have appropriate license.
74136
0.2.5
75-
* Severeral documentation & demo fixes.
137+
* Several documentation & demo fixes.
76138
0.2.4
77139
* Fix to work on Windows 7.
78140
* Python 3 compatibility in docs and demos.
@@ -81,9 +143,9 @@
81143
* Split changelog out into separate file.
82144
0.2.2
83145
* Fix bug which caused init() to raise, introduced in 0.2.1.
84-
* Remove asserts which cause problems in various circumstances. At least
85-
some users saw asserts fail on 'success' returned from win32 functions,
86-
even though the win32 functions appear to have worked correctly.
146+
* Remove asserts which cause problems in various circumstances. At least some
147+
users saw asserts fail on 'success' returned from win32 functions, even
148+
though the win32 functions appear to have worked correctly.
87149
0.2.1
88150
* Completely broken: I added a bug which caused init() to raise.
89151
* Added some documentation for cursor positioning and clear screen to README.
@@ -107,9 +169,9 @@
107169
file from building on a different platform.
108170
* Fix python3 incompatibility kindly reported by G |uumlaut| nter Kolousek
109171
0.1.14
110-
* Fix hard-coded reset to white-on-black colors. Fore.RESET, Back.RESET
111-
and Style.RESET_ALL now revert to the colors as they were when init()
112-
was called. Some lessons hopefully learned about testing prior to release.
172+
* Fix hard-coded reset to white-on-black colors. Fore.RESET, Back.RESET and
173+
Style.RESET_ALL now revert to the colors as they were when init() was
174+
called. Some lessons hopefully learned about testing prior to release.
113175
0.1.13
114176
* Completely broken: barfed when installed using pip.
115177
0.1.12
@@ -125,11 +187,11 @@
125187
* Remove setup.py dependency on setuptools, now uses stdlib distutils.
126188
0.1.8
127189
* Fix ghastly errors all over the place on Ubuntu.
128-
* Add init kwargs 'convert' and 'strip', which supercede the old 'wrap'.
190+
* Add init kwargs 'convert' and 'strip', which supersede the old 'wrap'.
129191
0.1.7
130192
* Python 3 compatible.
131-
* Fix: Now strips ansi on windows without necessarily converting it to
132-
win32 calls (eg. if output is not a tty.)
193+
* Fix: Now strips ansi on windows without necessarily converting it to win32
194+
calls (eg. if output is not a tty.)
133195
* Fix: Flaky interaction of interleaved ansi sent to stdout and stderr.
134196
* Improved demo.sh (hg checkout only.)
135197
0.1.6
@@ -156,4 +218,3 @@
156218

157219
.. |uumlaut| unicode:: U+00FC .. u with umlaut
158220
:trim:
159-

ENTERPRISE.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Colorama for enterprise.
2+
3+
*Available as part of the Tidelift Subscription.*
4+
5+
Tidelift is working with the maintainers of Colorama and thousands of other
6+
open source projects to deliver commercial support and maintenance for the open
7+
source dependencies you use to build your applications. Save time, reduce risk,
8+
and improve code health, while paying the maintainers of the exact dependencies
9+
you use.
10+
11+
[\[Learn More\]](https://tidelift.com/subscription/pkg/pypi-colorama?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=enterprise) [\[Request a demo\]](https://tidelift.com/subscription/request-a-demo?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=enterprise)
12+
13+
### Enterprise-ready open source software—managed for you
14+
15+
The Tidelift Subscription is a managed open source subscription for application dependencies covering millions of open source projects across JavaScript, Python, Java, PHP, Ruby, .NET, and more.
16+
17+
Your subscription includes:
18+
19+
**Security updates:**
20+
Tidelift’s security response team coordinates patches for new breaking security
21+
vulnerabilities and alerts immediately through a private channel, so your
22+
software supply chain is always secure.
23+
24+
**Licensing verification and indemnification:**
25+
Tidelift verifies license information to enable easy policy enforcement and
26+
adds intellectual property indemnification to cover creators and users in case
27+
something goes wrong. You always have a 100% up-to-date bill of materials for
28+
your dependencies to share with your legal team, customers, or partners.
29+
30+
**Maintenance and code improvement:**
31+
Tidelift ensures the software you rely on keeps working as long as you need it
32+
to work. Your managed dependencies are actively maintained and we recruit
33+
additional maintainers where required.
34+
35+
**Package selection and version guidance:**
36+
We help you choose the best open source packages from the start—and then guide
37+
you through updates to stay on the best releases as new issues arise.
38+
39+
**Roadmap input:**
40+
Take a seat at the table with the creators behind the software you use.
41+
Tidelift’s participating maintainers earn more income as their software is used
42+
by more subscribers, so they’re interested in knowing what you need.
43+
44+
**Tooling and cloud integration:**
45+
Tidelift works with GitHub, GitLab, BitBucket, and more. We support every cloud
46+
platform (and other deployment targets, too).
47+
48+
The end result? All of the capabilities you expect from commercial-grade software, for the full breadth of open source you use. That means less time grappling with esoteric open source trivia, and more time building your own applications—and your business.
49+
50+
[\[Learn More\]](https://tidelift.com/subscription/pkg/pypi-colorama?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=enterprise) [\[Request a demo\]](https://tidelift.com/subscription/request-a-demo?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=enterprise)
51+

LICENSE.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2525
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2626
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)