DOC: clarify and expand documentation about PYTHONUSERBASE and PYTHONNOUSERSITE#144637
DOC: clarify and expand documentation about PYTHONUSERBASE and PYTHONNOUSERSITE#144637tacaswell wants to merge 6 commits intopython:mainfrom
Conversation
Otherwise it is not clear how to disable user site-packages. Even though it is directly above, the link from the search results put the top of the page on PYHONUSERBASE and the user may not think to scroll up for critical context.
Now matches both site.rst and the actual implementation.
It is not otherwise documented that this implicitly disables user site-packages.
69f8de3 to
9cde670
Compare
There was a problem hiding this comment.
Thanks for working on this @tacaswell!
It overall looks good, and corrects some incorrect information, which is very helpful. I just have a couple comments.
| directories are added to the module search path. The :envvar:`PYTHONUSERBASE` | ||
| environment variable controls where is searched for user site-packages and the | ||
| :envvar:`PYTHONNOUSERSITE` environment variable prevents searching for user | ||
| site-packages all together. A common way to customize the search path is to |
There was a problem hiding this comment.
I think this should be in the paragraph below, together with their respective CLI flags.
| There are other ways how "virtual environments" could be implemented, this | ||
| documentation refers implementations based on the ``pyvenv.cfg`` mechanism, | ||
| such as :mod:`venv`. Most virtual environment implementations follow the | ||
| model set by :mod:`venv`, but there may be exotic implementations that | ||
| diverge from it. | ||
| There are many ways how "virtual environments" could be implemented. | ||
| This documentation refers to implementations based on the ``pyvenv.cfg`` | ||
| mechanism, such as :mod:`venv`, that many virtual environment implementations | ||
| follow. |
There was a problem hiding this comment.
I honestly don't think this paragraph needs a change. In fact, I think the new version removes some information that I think is helpful to the user.
|
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 erred on this not needing an issue to say "the docs could be improved" as that is always a true statement ;).
The changes are split up into individual commits for ease of review. The primary changes are:
include-system-site-packagesinpyvenv.cfgimplicitly also controls user site-packagessite.pydocstring (looks like it has always been wrong)📚 Documentation preview 📚: https://cpython-previews--144637.org.readthedocs.build/