-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
Decide the fate of undocumented script behavior of some modules #93096
Comments
|
@ericvsmith Thank you, I've added it to the list. |
This PR couples with python/pyperformance#222 and supersedes #92560. Inspired by #93096 (comment). Automerge-Triggered-By: GH:ericsnowcurrently
I wasn’t aware of this ticket! I suggest that discuss is a better place to reach a decision that a ticket. |
For deciding whether to expose the cli or not is probably worth a DPO thread, but deciding whether to remove or not the internal options meant for self-testing may be discussed in an issue directly I think (as we would just move self-tests/doctests to unittests and/or run them directly). |
I agree on this point – self-tests are better removed. But the ticket is also about other categories of scripts, which should not be decided by only a few devs here IMO. |
ping @hugovk as author of In discuss you suggested opening a new issue but I think this issue is more appropriate. If you don't mind such a change, then I will open a PR |
(cherry picked from commit 15a8412) Co-authored-by: donBarbos <donbarbos@proton.me>
(cherry picked from commit 15a8412) Co-authored-by: donBarbos <donbarbos@proton.me>
sorry, i didn't wait for you because i found that we already removed such thing for |
We have modules that don't have the
The problem is that these CLIs expect some arguments, but nowhere is it said which ones! (no docs, no help messages) I don't think help message is required for @vstinner does it make sense to open issue to send PRs? EDIT: I think this will add consistency to the behavior of CLI modules |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
There are three dozens of standard modules that can be called via
python -m
and their documentation doesn't mention it. They can be grouped into five categories:kind of smoke tests:
performs stdin:latin1 → utf-8 → latin1 → stdout passthroughedit: it just wraps stdin and stdout then just exits the script (gh-93096: Removepython -m codecs
#94233)python -m pprint
pyperformance#222)full-fledged crossplatform utils for admin-like users and small automation:
python
but allows to useawait
in top-level script codemimetypes
CLI tool public #93097).netrc
for a current userWindows-10-10.0.19044-SP0
; can be useful in automationboth:
base64 -t
encodes/decodesAladdin:open sesame
and tests if the result is the same as the original (gh-93096: Removepython -m base64 -t
#94230)demos with no real world application:
getopt: just passes arguments toThe module is no longer maintained after gh-106535: Soft deprecate the getopt module #105735getopt()
shlex()
and prints the list into stdoutcomplex matter; better leave untouched:
Eggs and to-be-removed modules aren't listed.
We need to decide what to do with all these undocumented categories.
I propose the following:
test
module with deduplicationCommand-Line Usage
into the docs like in https://docs.python.org/3/library/ast.html#command-line-usage or https://docs.python.org/3/library/trace.html#command-line-usageLinked PRs
-t
and-v
flags frompickletools
cli #131039-t
and-v
flags frompickle
cli #131068test_pickle
#131069test_pickle
(GH-131069) #131080test_pickle
(GH-131069) #131081pickle
CLI #131097difflib
#131099heapq
#131130test_itertools
#131133test_itertools
(GH-131133) #131136test_itertools
(GH-131133) #131137random
benchmark into pyperformance #131144pickletools
CLI #131273test_mimetypes.test_guess_type_conflicting_with_mimetypes
#131408The text was updated successfully, but these errors were encountered: