Releases: hamdanal/rich-argparse
Version 1.7.0
This is the last release to support Python 3.8
Introducing auto-rich-argparse
🚀
Improve the help output of your favorite argparse command line tool by simply installing auto-rich-argparse
in its environment. Try it out with your favorite tool using:
uvx --with auto-rich-argparse <YOUR_FAVORITE_TOOL> --help
Read more at https://github.com/hamdanal/auto-rich-argparse.
Incoming Change in Version 2.0
In rich-argparse 2.0, rich markup will become opt in instead of opt out. This means usages like this:
parser.add_argument("--foo", help="[red]This text is in red[/]")
Will need to set the option RichHelpFormatter.help_markup = True
to work as expected. Please see #151 for context and to give feedback.
What's Changed
This release adds new features and fixes a few bugs.
Features
- Add support for django commands in the new
rich_argparse.django
module. Read more at https://github.com/hamdanal/rich-argparse#django-support. Contributed in #149 - Add
ParagraphRichHelpFormatter
, a formatter that preserves paragraph breaks, in the newrich_argparse.contrib
module. Read more at https://github.com/hamdanal/rich-argparse#additional-formatters. Contributed in #147
Fixes
- Fix
ValueError
when using%(default)s
inside square brackets andhelp_markup
is enabled. Contributed in #153 and #154 - Do not highlight --options inside backticks. Contributed in #142
Other Changes
- Start testing on Python 3.14 by @hamdanal in #137
- Use native toml for tox configuration by @hamdanal in #138
- sdist: include the tests by @mr-c in #139
- Reorganize the project modules by @hamdanal in #144
- Run skipped test on Python 3.13 by @hamdanal in #145
- Replace tox by uv by @hamdanal in #146
- Bump astral-sh/setup-uv from 4 to 5 by @dependabot in #148
- Add python nightly workflow by @hamdanal in #150
New Contributors
Full Changelog: v1.6.0...v1.7.0
Version 1.6.0
What's Changed
- Improved way to create metavars coloured strings by @atteggiani in #128
- Do not wrap long group titles by @hamdanal in #131
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #132
- Fix help preview generation with newer releases of rich by @hamdanal in #135
- Update RichHelpFormatter.add_text() type hint to reflect its ability to take a Rich renderable. by @kmvanbrunt in #134
New Contributors
- @atteggiani made their first contribution in #128
- @kmvanbrunt made their first contribution in #134
Full Changelog: v1.5.2...v1.6.0
Version 1.5.2
Fix a regression in version 1.5.1 in the handling of %(default)s
style. The regression crashed the formatter in certain situations when %(default)s
comes after a markup text.
What's Changed
Full Changelog: v1.5.1...v1.5.2
Version 1.5.1
What's Changed
Full Changelog: v1.5.0...v1.5.1
Version 1.5.0
Highlights of the release
- PR-103 Python 3.13 is now officially supported
- GH-95, PR-103 Python 3.7 is no longer supported (EOL since 27/6/2023)
- GH-120, GH-121, PR-122 Add options
help_markup
andtext_markup
to disable console markup in the help text and the description text respectively. - GH-115, PR-116 Do not print group names suppressed with
argparse.SUPPRESS
What's Changed
- Drop support for python 3.7 and add 3.13 to CI by @hamdanal in #103
- Use the ruff formatter by @hamdanal in #104
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #105
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #106
- Bump actions/setup-python from 4 to 5 by @dependabot in #107
- Update dependencies and fix CI by @hamdanal in #108
- Bump actions/upload-artifact from 3 to 4 by @dependabot in #109
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #110
- Update dev tools by @hamdanal in #113
- New README preview by @hamdanal in #114
- Do not print suppressed group names by @hamdanal in #116
- Add options to disable console markup by @hamdanal in #122
New Contributors
- @dependabot made their first contribution in #107
Full Changelog: v1.4.0...v1.5.0
Version 1.4.0
Highlights of the release
- Add
HelpPreviewAction
to generate a preview of the help output in SVG, HTML, or TXT formats. - Allow arbitrary renderables like Markdown and Table in the descriptions and epilog.
What's Changed
- Update pre-commit and github actions by @hamdanal in #89
- Make
RichHelpFormatter
itself renderable with rich by @hamdanal in #90 - Allow passing a custom console to the formatter by @hamdanal in #92
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #94
- Add action to generate SVG, HTML, or TXT help preview by @hamdanal in #93
- Add links to the changelog by @hamdanal in #96
- Avoid importing
typing
to improve startup time 35% by @hamdanal in #97 - Add a style for default values when using
%(default)s
by @hamdanal in #98 - Allow arbitrary renderables in the descriptions and epilog by @hamdanal in #99
- Fix color of brackets surrounding positional arguments in the usage by @hamdanal in #101
Full Changelog: v1.3.0...v1.4.0
Version 1.3.0
Highlights of the release
- Experimental support for optparse now includes auto generation of usage string from options (similar to argparse).
See https://github.com/hamdanal/rich-argparse#optparse-support for more. - Fix ansi codes not correctly displayed on legacy Windows consoles
What's Changed
- Use
strip_control_codes
from rich by @hamdanal in #75 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #76
- Fix ansi escape codes on legacy windows console by @hamdanal in #80
- Improve the README by @hamdanal in #83
- Support older windows with colorama by @hamdanal in #85
- Fix typos by @kianmeng in #86
- Improve optparse by @hamdanal in #87
New Contributors
Full Changelog: v1.2.0...v1.3.0
Version 1.2.0
Highlights of the release
Experimental support for optparse help formatters.
See https://github.com/hamdanal/rich-argparse#optparse-support for more.
What's Changed
- Make rich_argparse a package by @hamdanal in #71
- Use ruff and update pre-commit by @hamdanal in #72
- Add experimental optparse support by @hamdanal in #73
- Properly handle escaping of control codes in usage and metavars by @hamdanal in #74
Full Changelog: v1.1.1...v1.2.0
Version 1.1.1
Version 1.1.0
Highlights of the release
New style argparse.prog
for the program name placeholder %(prog)s
in the usage.
What's Changed
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #52
- Add a style for %(prog)s in the usage by @hamdanal in #56
- Refactor by @hamdanal in #57
- New readme image by @novitae in #58
- Minor improvements and grammar fixes by @hamdanal in #63
New Contributors
Full Changelog: v1.0.0...v1.1.0