NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #3501 most downloaded on PyPI
Detect test environment - pytest, doctest, unittest, or regular execution
Latest stable
3.0.7
Last release 24 days ago
28 Oct 2026
Ships unpredictably
gaps range from 2 weeks to 2.3 years
Nearly every release is documented
notes for 22 of 22 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
22 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
is_pytest_active() and is_testenv_active() called without an arg_string return True inside a pytest-xdist worker. A worker runs as python -c, so its s
is_pytest_active() and is_testenv_active() called without an arg_string return True
inside a pytest-xdist worker. A worker runs as python -c, so its sys.argv names neither
pytest nor a test file and both returned False there; they now also check the
PYTEST_XDIST_WORKER variable xdist sets in every worker. A call given an arg_string is still
judged on that string alone.pytest-xdist joins the dev extra and the workers = 1 setting that
kept make test serial is gone.The source distribution ships only the package, its tests, its docs, README.md, LICENSE, CHANGELOG.md and pyproject.toml (an include list). Earlier sd
README.md, LICENSE,
CHANGELOG.md and pyproject.toml (an include list). Earlier sdists also carried every other
root file and, in a local build, anything hidden only through .git/info/exclude or a nested
.gitignore. tests/test_packaging.py builds the sdist and wheel and checks both; hatchling
joins the dev extra for it.C90 (mccabe), so a function over cyclomatic complexity 10, the house hard limit,
now fails make test; before, nothing enforced it.os_windows, os_macos, os_linux and os_posix markers now skip a test off its platform
(pytest_runtest_setup in tests/conftest.py); registered in pyproject.toml alone they skipped
nothing, so a test trusting its marker ran everywhere. tests/test_platform_markers.py pins it.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Python 3.15 is a supported version: declared in the classifiers, so CI and make test-all run it.
make test-all run it.uv.lock is committed, and [tool.uv] exclude-newer sets a cooldown that keeps releases younger
than it out of the lock. CI installs exactly the locked tree on push and pull request; the nightly
scheduled run still resolves afresh to catch upstream breakage early.pip install from PyPI does not.rtoml floor raised to 0.14.0, the first release with Python 3.15 wheels.Console output no longer crashes on a legacy codepage. A Windows console at codepage 1252 hands Python an errors="strict" stream, so writing a non-ASC
errors="strict" stream, so writing a non-ASCII character such as a check mark
raised UnicodeEncodeError: 'charmap' codec can't encode character and the command exited
non-zero after its work had already succeeded. Click does not protect against this, and Rich
raises the same way through its own writer. The new safe_console module degrades at the sink:
a UTF-8 terminal still receives the character, and only a stream that cannot encode it sees
[OK] / [X] / [!]. Every click.echo call site routes through it, and a test fails if a
module reaches for click.echo or builds an unwrapped Console(file=sys.stdout) again.Fixed CI going red under the latest ruff (0.16 widened its default rule set to ~920 rules on a repo with no explicit [tool.ruff.lint].select): pinned
[tool.ruff.lint].select): pinned the curated bitranox rule select instead
of chasing the exploded default set.raise SystemExit(2) in the CLI's error handlers now uses from e so tracebacks show the
original cause (B904).print_info() and the __main__ guard now write via sys.stdout/sys.stderr instead of print,
fixing a latent bug where the guard printed a bytes literal's repr instead of the plain message.[tool.ruff.lint].select (matching bitranox_template_py_cli) plus
pydocstyle Google convention and a tests/*.py per-file-ignore list, replacing the previous
no-select config that inherited ruff's entire default rule set.*,) so ruff's PLR0917 no longer fires;
Click already invokes command callbacks by keyword, so this is not a call-site change.if/return True/False branches in lib_detect_testenv.py to direct
return <condition> expressions (SIM103).import sys/from rich.style import Style statements in cli.py
to the module top (PLC0415).Optional[X] with X | None throughout cli.py (UP045).Added a typed_click.py facade wrapping rich-click's option / version_option decorators behind explicit, fully-known signatures, keeping the CLI strict
typed_click.py facade wrapping rich-click's option / version_option decorators behind explicit, fully-known signatures, keeping the CLI strict-clean under pyright (reportUnknownMemberType). The repo-wide reportUnknownMemberType suppression is retained, but only for the tomli backport (untyped on Python 3.10); the rich-click decorators no longer rely on it.scripts/ package to the external bmk tooling (uvx bmk); removed the obsolete scripts/ directory and [tool.scripts.test] config; added [tool.bashate] settings and the bmk CI workflows.requires-python>=3.10): the bmk build/dev toolchain requires Python 3.10+.Replaced tomllib/tomli with rtoml for TOML parsing in scripts
tomllib/tomli with rtoml for TOML parsing in scriptsactions/cache v4 → v5actions/upload-artifact v5 → v6PYTHONIOENCODING: "utf-8" environment variable to CI workflow for consistent encodingadd_path_to_syspath() function to add paths to sys.path with duplicate prevention
Core Library Features:
add_path_to_syspath() function to add paths to sys.path with duplicate preventionCLI Detection Commands:
check - Check if any test environment is active (pytest, doctest, setup.py test)pytest - Check if pytest is activedoctest - Check if doctest is activesetup - Check if setup.py is active--quiet flag for all detection commands (exit code only, no output)--arg-string option to test custom argument strings--test-only flag for setup command (check only "setup.py test")CLI Utility Commands:
hello - Demo command to print greeting messagefail - Demo command to trigger intentional failure for testing error handlinginfo - Display package metadata and version information3-Level Exit Code System:
Comprehensive Test Suite:
Documentation:
BREAKING CHANGES:
detect_testenv.py to lib_detect_testenv.pyrich-click>=1.9.4 required for CLI functionality
dependencies = ["rich-click>=1.9.4"] - Required for CLI entry pointis_pytest_active(), etc.) without using rich-clickConfiguration:
["logging", "rich", "cli", "terminal", "ansi"] to ["testing", "pytest", "doctest", "unittest", "test-detection", "test-environment"] for accurate PyPI discoverabilityDocumentation:
check command when invoked without argumentsremove dependency cli_exit_tools to avoid circular dependency
2023-07-14: - remove dependency click - remove dependency cli_exit_tools to avoid circular dependency
move 3rd_party_stubs outside the src directory
2023-07-14: - add codeql badge - move 3rd_party_stubs outside the src directory - add pypy 3.10 tests - add python 3.12-dev tests
v2.0.6 --------- 2023-07-13: - require minimum python 3.8 - remove python 3.7 tests
2023-07-13: - require minimum python 3.8 - remove python 3.7 tests
introduce PEP517 packaging standard
2023-07-11: - introduce PEP517 packaging standard - introduce pyproject.toml build-system - remove mypy.ini - remove pytest.ini - remove setup.cfg - remove setup.py - remove .bettercodehub.yml - remove .travis.yml - update black config
2023-06-26: suppress upload of .egg files to pypi.org
2023-06-26: suppress upload of .egg files to pypi.org
v2.0.3 2023-01-13: update github actions : checkout@v3 and setup-python@v4 remove "better code" badges remove python 3.6 tests add python 3.11 tests u
v2.0.3 2023-01-13: update github actions : checkout@v3 and setup-python@v4 remove "better code" badges remove python 3.6 tests add python 3.11 tests update to pypy 3.9 tests
2022-06-02: update to github actions checkout@v3 and setup-python@v3
2022-06-02: update to github actions checkout@v3 and setup-python@v3
2022-06-01: update github actions test matrix
2022-06-01: update github actions test matrix
2022-03-29: remedy mypy Untyped decorator makes function "cli_info" untyped
2022-03-29: remedy mypy Untyped decorator makes function "cli_info" untyped
2022-03-25: fix github actions windows test
2022-03-25: fix github actions windows test
v2.0.0 ------- 2021-11-23: - add "setup.py test" detection
2021-11-23: - add "setup.py test" detection
remove second github action yml
2021-11-22: - remove second github action yml - fix "setup.py test"
2021-11-21: implement github actions
2021-11-21: implement github actions
2021-11-18: v1.0.0 initial release
2021-11-18: v1.0.0 initial release
One column per quarter.