SF.net SVN: docutils:[10132 ] trunk/docutils
milde--- via Docutils-checkins <[email protected]> Fri, 16 May 2025 13:38:58 +0000
| Newsgroups | gmane.text.docutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 10132
http://sourceforge.net/p/docutils/code/10132
Author: milde
Date: 2025-05-16 13:38:58 +0000 (Fri, 16 May 2025)
Log Message:
-----------
Announce switch to "argparse" for Docutils 2.0 or later.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/user/config.rst
trunk/docutils/docutils/frontend.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-16 12:39:28 UTC (rev 10131)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-16 13:38:58 UTC (rev 10132)
@@ -40,7 +40,11 @@
For the rationale, see https://clig.dev/#arguments-and-flags.
+* The `front end tools`_ will use argparse_ for command line parsing
+ in Docutils 2.0 or later.
+ .. _argparse: https://docs.python.org/3/library/argparse.html
+
Document Tree / Docutils DTD
----------------------------
@@ -187,6 +191,10 @@
`states.RSTState.title_inconsistent()`, and `states.Line.eofcheck`
in Docutils 2.0. Ignored since Docutils 0.22.
+* Remove `frontend.OptionParser`, `frontend.Option`, `frontend.Values`,
+ `frontend.store_multiple()`, and `frontend.read_config_file()` when
+ migrating to argparse_ in Docutils 2.0 or later.
+
Misc
----
Modified: trunk/docutils/docs/user/config.rst
===================================================================
--- trunk/docutils/docs/user/config.rst 2025-05-16 12:39:28 UTC (rev 10131)
+++ trunk/docutils/docs/user/config.rst 2025-05-16 13:38:58 UTC (rev 10132)
@@ -2430,7 +2430,7 @@
~~~~~~
Path to an additional configuration file.
The file is processed immediately (if it exists) with
-settings overriding defaults and earlier settings.
+settings overriding defaults and earlier settings. [#config-change]_
Filesystem path settings [#pwd]_ contained within the config file will be
interpreted relative to the config file's location (*not* relative to the
@@ -2437,11 +2437,17 @@
current working directory).
Multiple ``--config`` options may be specified;
-each will be processed in turn.
+each will be processed in turn. [#config-change]_
*Default*: None. *Option*: ``--config``.
+.. [#config-change] After the `transition to the "argparse" module`__,
+ files specified with the ``--config`` option will be appended
+ to the list of `configuration files`_ and evaluated before any
+ other command line arguments.
+ __ ../../RELEASE-NOTES.html#command-line-interface
+
Internal Settings
-----------------
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2025-05-16 12:39:28 UTC (rev 10131)
+++ trunk/docutils/docutils/frontend.py 2025-05-16 13:38:58 UTC (rev 10132)
@@ -6,8 +6,8 @@
Command-line and common processing for Docutils front-end tools.
This module is provisional.
-Major changes will happen with the switch from the deprecated
-"optparse" module to "arparse".
+Major changes will happen with the transition from the
+"optparse" module to "arparse" in Docutils 2.0 or later.
Applications should use the high-level API provided by `docutils.core`.
See https://docutils.sourceforge.io/docs/api/runtime-settings.html.
@@ -30,7 +30,7 @@
`get_default_settings()`. New in 0.19.
Option callbacks:
- `store_multiple()`, `read_config_file()`. Deprecated.
+ `store_multiple()`, `read_config_file()`. Deprecated. To be removed.
Setting validators:
`validate_encoding()`, `validate_encoding_error_handler()`,
@@ -101,6 +101,8 @@
Store `None` for each attribute named in `args`, and store the value for
each key (attribute name) in `kwargs`.
+
+ Deprecated. Will be removed with the switch to from optparse to argparse.
"""
for attribute in args:
setattr(parser.values, attribute, None)
@@ -115,6 +117,8 @@
) -> None:
"""
Read a configuration file during option processing. (Option callback.)
+
+ Deprecated. Will be removed with the switch to from optparse to argparse.
"""
try:
new_settings = parser.get_config_file_settings(value)
@@ -508,7 +512,8 @@
def make_one_path_absolute(base_path: StrPath, path: StrPath) -> str:
# deprecated, will be removed
warnings.warn('frontend.make_one_path_absolute() will be removed '
- 'in Docutils 0.23.', DeprecationWarning, stacklevel=2)
+ 'in Docutils 2.0 or later.',
+ DeprecationWarning, stacklevel=2)
return os.path.abspath(os.path.join(base_path, path))
@@ -555,7 +560,7 @@
def __init__(self, defaults: dict[str, Any] | None = None) -> None:
warnings.warn('frontend.Values class will be removed '
- 'in Docutils 0.21 or later.',
+ 'in Docutils 2.0 or later.',
DeprecationWarning, stacklevel=2)
super().__init__(defaults=defaults)
if getattr(self, 'record_dependencies', None) is None:
@@ -606,7 +611,7 @@
def __init__(self, *args: str | None, **kwargs: Any) -> None:
warnings.warn('The frontend.Option class will be removed '
- 'in Docutils 0.21 or later.',
+ 'in Docutils 2.0 or later.',
DeprecationWarning, stacklevel=2)
super().__init__(*args, **kwargs)
@@ -903,7 +908,7 @@
warnings.warn(
'The frontend.OptionParser class will be replaced by a subclass '
- 'of argparse.ArgumentParser in Docutils 0.21 or later.\n '
+ 'of argparse.ArgumentParser in Docutils 2.0 or later.\n '
'To get default settings, use frontend.get_default_settings().',
DeprecationWarning, stacklevel=2)
super().__init__(option_class=Option, add_help_option=False,
@@ -1086,7 +1091,7 @@
if option_parser is not None:
warnings.warn('frontend.ConfigParser.read(): parameter '
'"option_parser" will be removed '
- 'in Docutils 0.21 or later.',
+ 'in Docutils 2.0 or later.',
DeprecationWarning, stacklevel=2)
read_ok = []
if isinstance(filenames, str):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
Docutils-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-checkins