Skip to content

Fix custom HelpFormatter for Python 3.14 #3524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025

Conversation

The-Compiler
Copy link
Member

@The-Compiler The-Compiler commented May 8, 2025

python/cpython#132323 passes prefix_chars= (and other arguments) to the formatter_class, but the custom HelpFormatter only accepted prog=.

Accept any keyword arguments and pass them on to the parent class.

Fixes #3523

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

python/cpython#132323 passes prefix_chars=
(and other arguments) to the formatter_class, but the custom HelpFormatter only
accepted prog=.

Accept any keyword arguments and pass them on to the parent class.

Fixes tox-dev#3523
@The-Compiler
Copy link
Member Author

The-Compiler commented May 8, 2025

RTD build failure is unrelated:

  File "/home/docs/checkouts/readthedocs.org/user_builds/tox/checkouts/3524/.tox/docs/lib/python3.13/site-packages/snowballstemmer/__init__.py", line 27, in stemmer
    raise KeyError("Stemming algorithm '%s' not found" % lang)
KeyError: "Stemming algorithm 'porter' not found"

Test failures seem unrelated too:

ERROR: Could not find a version that satisfies the requirement wheel (from versions: none)

@henryiii
Copy link
Contributor

henryiii commented May 8, 2025

GitHub Actions supports 3.14 beta 1 (which is why I saw this error in wntrblm/nox#970), so it could be added to the CI.

@henryiii
Copy link
Contributor

henryiii commented May 8, 2025

The snowball thing is yanked, so that should be fine now. The wheel change is something separate that needs fixing in the tests, probably related to virtualenv.

@henryiii
Copy link
Contributor

henryiii commented May 8, 2025

I'm also seeing this locally:

AttributeError: 'VirtualEnvOptions' object has no attribute 'copies'

Copy link
Contributor

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edgarrmondragon edgarrmondragon mentioned this pull request May 12, 2025
5 tasks
@gaborbernat gaborbernat merged commit 19126da into tox-dev:main May 13, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.14: TypeError: HelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars'
4 participants