Skip to content
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

bpo-38623: Add note about site module (site-packages) #16974

Merged
merged 3 commits into from Sep 23, 2021
Merged

bpo-38623: Add note about site module (site-packages) #16974

merged 3 commits into from Sep 23, 2021

Conversation

bittner
Copy link
Contributor

@bittner bittner commented Oct 28, 2019

Adds a information about "site-packages" in a concise way.

Background

A popular question on StackOverflow is, "How do I find the location of my Python site-packages directory?"

While this may hint at a deeper problem that needs to be solved, a user suggested the accepted answer to be added to Python's official documentation.

https://bugs.python.org/issue38623

Copy link
Contributor

@eamanu eamanu left a comment

I don't know if is responsible of the Python documentation solve Stackoverflow questions. But IMHO this is a good improve

@bittner
Copy link
Contributor Author

bittner commented Oct 29, 2019

I don't know if is responsible of the Python documentation solve Stackoverflow questions. But IMHO this is a good improve

Seriously, the StackOverflow question is already solved for quite some time. This is about improving the Python documentation in a way that would make it unnecessary for people to look for a solution in the Internet.

I'd be open for suggestions to find an even better place for this type of information, or a better way of explaining the facts. You may have noticed that on StackOverflow the answer is much more elaborated and enriched with hands-on tips. Not sure if the tutorial would be a good place for that; I wanted to keep it concise.

@bittner
Copy link
Contributor Author

bittner commented Nov 1, 2019

Is this PR okay to be merged? Anything I may improve or change?

@bittner
Copy link
Contributor Author

bittner commented Nov 13, 2019

Can we merge this enhancement? Please let me know if there's anything missing for it to get merged.

Copy link
Member

@brandtbucher brandtbucher left a comment

Thanks for the PR @bittner!

@bittner
Copy link
Contributor Author

bittner commented Dec 3, 2019

Can I help somehow to bring this PR to the the next stage, the "core review" mentioned above?

Doc/tutorial/modules.rst Outdated Show resolved Hide resolved
@bittner
Copy link
Contributor Author

bittner commented Jan 8, 2020

The tutorial would now contain the word "site-packages", which can attract organic search traffic. The contributed text contains a link to the site module for people who are interested more deeply (in technical background information).

@@ -191,7 +191,8 @@ named :file:`spam.py` in a list of directories given by the variable
file is specified).
* :envvar:`PYTHONPATH` (a list of directory names, with the same syntax as the
shell variable :envvar:`PATH`).
* The installation-dependent default.
* The installation-dependent default (by convention including a
``site-packages`` directory, handled by the :mod:`site` module).
Copy link
Member

@methane methane Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this is just a noise for tutorial readers.

We don't introduce even standard library (it is introduced in 6.2). So we shouldn't mention about what is in the "installation-dependent default" in this chapter. It should be just "some other directories" for the readers here.

If you really want to document site-packages, I think Python Setup and Usage or Installing Python Modules is better place.

Copy link
Member

@nedbat nedbat Feb 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to the reader what "handled" means here. What would a reader of the tutorial do with the site module?

Copy link
Contributor Author

@bittner bittner Mar 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "taken care of [by ...]" be better, maybe? This is mainly a referral to the first paragraph of the site module documentation, which says:

This module is automatically imported during initialization.

The tutorial reader, which may be someone having landed here by organic search traffic (i.e. not necessarily a Python novice), may get a hint on what "installation-dependent default[s]" are (via "site-packages") and where to read more about it (via the link to the site module documentation).

Copy link
Member

@nedbat nedbat Mar 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess i don't understand why any reader needs to know what module placed site-packages into the import path? Just because someone might land on this page through a search doesn't mean we should add every fact to it. The tutorial should first and foremost be useful to read by beginners. This addition seems like a confusing addition.

@ambv
Copy link
Contributor

ambv commented Sep 23, 2021

Closing and re-opening to re-trigger CI.

@ambv ambv closed this Sep 23, 2021
@ambv ambv reopened this Sep 23, 2021
@ambv ambv merged commit 55b45bf into python:main Sep 23, 2021
12 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Sep 23, 2021

Thanks @bittner for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒🤖

@bedevere-bot
Copy link

bedevere-bot commented Sep 23, 2021

GH-28536 is a backport of this pull request to the 3.10 branch.

@bedevere-bot
Copy link

bedevere-bot commented Sep 23, 2021

GH-28537 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2021
(cherry picked from commit 55b45bf)

Co-authored-by: Peter Bittner <django@bittner.it>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2021
(cherry picked from commit 55b45bf)

Co-authored-by: Peter Bittner <django@bittner.it>
@bittner bittner deleted the feature/mention-site-module-in-docs branch Sep 23, 2021
ambv pushed a commit that referenced this pull request Sep 23, 2021
…28536)

(cherry picked from commit 55b45bf)

Co-authored-by: Peter Bittner <django@bittner.it>
ambv pushed a commit that referenced this pull request Sep 23, 2021
…28537)

(cherry picked from commit 55b45bf)

Co-authored-by: Peter Bittner <django@bittner.it>
pablogsal pushed a commit that referenced this pull request Sep 29, 2021
…28536)

(cherry picked from commit 55b45bf)

Co-authored-by: Peter Bittner <django@bittner.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants