Support Python 3.14.0b1
This commit is contained in:
parent
104f6b73e2
commit
17cf20500b
2 changed files with 43 additions and 0 deletions
40
3524.patch
Normal file
40
3524.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
From 3c5d56bf8bb8405d0eceef912ba4cad7d077448c Mon Sep 17 00:00:00 2001
|
||||
From: Florian Bruhin <me@the-compiler.org>
|
||||
Date: Thu, 8 May 2025 10:47:22 +0200
|
||||
Subject: [PATCH] Fix custom HelpFormatter for Python 3.14
|
||||
|
||||
https://github.com/python/cpython/pull/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
|
||||
---
|
||||
docs/changelog/3523.bugfix.rst | 1 +
|
||||
src/tox/config/cli/parser.py | 4 ++--
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
create mode 100644 docs/changelog/3523.bugfix.rst
|
||||
|
||||
diff --git a/docs/changelog/3523.bugfix.rst b/docs/changelog/3523.bugfix.rst
|
||||
new file mode 100644
|
||||
index 000000000..3052d877e
|
||||
--- /dev/null
|
||||
+++ b/docs/changelog/3523.bugfix.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Fix ``TypeError`` for ``HelpFormatter`` with Python 3.14
|
||||
diff --git a/src/tox/config/cli/parser.py b/src/tox/config/cli/parser.py
|
||||
index 87629ae49..904ff7aad 100644
|
||||
--- a/src/tox/config/cli/parser.py
|
||||
+++ b/src/tox/config/cli/parser.py
|
||||
@@ -95,8 +95,8 @@ def parse_args( # type: ignore[override] # avoid defining all overloads
|
||||
class HelpFormatter(ArgumentDefaultsHelpFormatter):
|
||||
"""A help formatter that provides the default value and the source it comes from."""
|
||||
|
||||
- def __init__(self, prog: str) -> None:
|
||||
- super().__init__(prog, max_help_position=30, width=240)
|
||||
+ def __init__(self, prog: str, **kwargs: Any) -> None:
|
||||
+ super().__init__(prog, max_help_position=30, width=240, **kwargs)
|
||||
|
||||
def _get_help_string(self, action: Action) -> str | None:
|
||||
text: str = super()._get_help_string(action) or ""
|
||||
|
|
@ -28,6 +28,9 @@ License: MIT
|
|||
URL: https://tox.readthedocs.io/
|
||||
Source: %{pypi_source tox}
|
||||
|
||||
# Support Python 3.14.0b1
|
||||
Patch: https://github.com/tox-dev/tox/pull/3524.patch
|
||||
|
||||
# Remove dependency on devpi-process.
|
||||
# Remove dependency on detect-test-pollution.
|
||||
# Remove coverage-related dependencies.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue