mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 11:19:50 +03:00
https://sphinx-argparse.readthedocs.io/en/latest/ Sphinx extension that automatically documents argparse commands and options
20 lines
999 B
Diff
20 lines
999 B
Diff
Fix tests failing because of a change in Python 3.10 argparse
|
|
|
|
Modified from https://github.com/ashb/sphinx-argparse/commit/a7b186aa60cf256dd91268ca3c18e78ef6644223
|
|
Removed the changes to CI matrix since it doesn't exist in the PyPI tarball
|
|
|
|
diff --git a/sphinxarg/parser.py b/sphinxarg/parser.py
|
|
index 9a6f76a..89583c6 100644
|
|
--- a/sphinxarg/parser.py
|
|
+++ b/sphinxarg/parser.py
|
|
@@ -154,7 +154,9 @@ def parse_parser(parser, data=None, **kwargs):
|
|
continue
|
|
|
|
# Upper case "Positional Arguments" and "Optional Arguments" titles
|
|
- if action_group.title == 'optional arguments':
|
|
+ # Since python-3.10 'optional arguments' changed to 'options'
|
|
+ # more info: https://github.com/python/cpython/pull/23858
|
|
+ if action_group.title == 'optional arguments' or action_group.title == 'options':
|
|
action_group.title = 'Named Arguments'
|
|
if action_group.title == 'positional arguments':
|
|
action_group.title = 'Positional Arguments'
|