Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-130160: use.. program::
directive for documentingvenv
CLI#130699
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
.. program::
directive for documentingvenv
CLI.. program::
directive for documentingvenv
CLIThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I can't see what the.. program::
directive does in the documentation preview. It would be good to see screenshot(s) to show rendering of this section before/after your changes.
Mr-Sunglasses commentedFeb 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@vsajip these are the changes ( with screenshot attached ) Before: ![]() After: ![]() |
So we've duplicated the options information in the bit below "The command, if run with -h, will show the available options:" , in a slightly different formatting? What has that really achieved? And what did the |
Mr-Sunglasses commentedFeb 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@vsajip You're absolutely right that the options information is now duplicated in two slightly different formats:
Now for the second question
The That said, I totally get your point about duplication. If you feel the duplication is unnecessary, we could remove the raw About the It tells Sphinx that the following options ( ref.https://www.sphinx-doc.org/en/master/usage/domains/standard.html#directive-program
My motivation for making this change comes from a few observations in the issue#130160 :
That said, I completely understand your perspective. If the previous presentation wasn’t broken, why fix it? My goal wasn’t to tinker for the sake of tinkering but to subtly improve the docs in a way that aligns with broader Python documentation practices. If you’re not convinced that these changes add enough value, I’m happy to roll them back or refine them further. Please Let me know what you think! |
Well, that's not good, in my view. I have no particular opinion on the
Well, I didn't see any in But the duplication has to go, IMO. Note that if you remove the I see#130160 is trying to do this across various modules in the stdlib, so fair enough, I suppose ... my main concern is the extra work for maintainers (for this module, that's often me!) when the CLI changes. |
vsajip commentedFeb 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Mr-Sunglasses commentedMar 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yeah, we did not want to close it until we update the targeted docs, I'll update it, thanks@vsajip |
Mr-Sunglasses commentedMar 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for your suggesstions,@vsajip .
Just my two cents, it will need a little bit of extra work while adding new features but it will make the docs overall better. tagging@picnixz for his views, as he is helping me a lot in this issue and he originally created the issue. TiA.
|
picnixz commentedMar 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There are benefits for having the
If you however think that it's not worth the change, we can skip that one. I can understand that it's easier to C/C if you already have an ArgumentParser outputting you the options. But for some modules, the option description may use backreferences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
tagging@vsajip for their opinion on this discussion and their opinion on this PR.
I thought I'd made that clear, but to reiterate:
I hope that all makes sense! |
Uh oh!
There was an error while loading.Please reload this page.
Doc/library/venv.rst Outdated
The command, if run with ``-h``, will show the available options:: | ||
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@Mr-Sunglasses I understood that the problem is that there is duplicate information aboutvenv
cli (you didn't replace it, you just added a new one, check these lines and below)
could you remove it leaving only the use of.. option::
directives?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
could you remove it leaving only the use of .. option:: directives?
There should IMO be something that shows how to invoke it, e.g.python -m venv [options] [VENV_DIR ...]
appropriately marked up to be as prominent/compatibly styled to theoption
directive rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You are absolutely right. I forgot about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In this case, I suggest shortening the help. Currently it's as follows:
Instead I suggest we only keep
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps] [--without-scm-ignore-files] ENV_DIR [ENV_DIR ...]Creates virtual Python environments in one or more target directories....Once an environment has been created, you may wish to activate it, e.g. bysourcing an activate script in its bin directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
and maybe it would be better to remove following text from code block:
Creates virtual Python environments in one or more target directories....Once an environment has been created, you may wish to activate it, e.g. bysourcing an activate script in its bin directory.
Uh oh!
There was an error while loading.Please reload this page.
@Mr-Sunglasses This is the last PR to remain before closing the parent issue. May you address the comments please? (or we can also skip the venv module or take over the PR if you don't want to work on this) |
Hey@picnixz , Sorry I forgot about this PR, I'll work on it and resolve the issues. |
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I missed some stuff before. Please address them.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again. cc.@picnixz |
Thanks for making the requested changes! @picnixz: please review the changes made to this pull request. |
Uh oh!
There was an error while loading.Please reload this page.
Issue:#130160
.. program::
and.. option::
directives for modules with a documented CLI #130160📚 Documentation preview 📚:https://cpython-previews--130699.org.readthedocs.build/