Skip to content

Conversation

@asnelling
Copy link

@asnelling asnelling commented Feb 24, 2022

Adding prefixes argument from code below to site.getsitepackages docs.

cpython/Lib/site.py

Lines 346 to 352 in 7fce106

def getsitepackages(prefixes=None):
"""Returns a list containing all global site-packages directories.
For each directory present in ``prefixes`` (or the global ``PREFIXES``),
this function will find its `site-packages` subdirectory depending on the
system environment, and will return a list of full paths.
"""

Introduced in commit 7ded1f0

https://bugs.python.org/issue46826

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Feb 24, 2022
Return a list containing all global :file:`site-packages` directories.

For each directory present in *prefixes* (or :data:`PREFIXES` if *prefixes*
is None), this function will find its :file:`site-packages` subdirectory
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
is None), this function will find its :file:`site-packages` subdirectory
is ``None``), this function will find its :file:`site-packages` subdirectory

@@ -0,0 +1 @@
document prefixes argument on site.getsitepackages
Copy link
Contributor

@slateny slateny Oct 2, 2022

Choose a reason for hiding this comment

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

As it's a doc change I'd say you can remove this file

Actually, since it documents a new parameter it might be useful to have the news.

Suggested change
document prefixes argument on site.getsitepackages
Document prefixes argument for :func:`~site.getsitepackages`.

@slateny
Copy link
Contributor

slateny commented Dec 6, 2022

@asnelling Would you still be interested in giving the PR a quick update?

.. function:: getsitepackages(prefixes=None)

Return a list containing all global site-packages directories.
Return a list containing all global :file:`site-packages` directories.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Return a list containing all global :file:`site-packages` directories.
Return a list containing all global site-packages directories.

This should be reverted, it does not do what you think it does.

Return a list containing all global :file:`site-packages` directories.

For each directory present in *prefixes* (or :data:`PREFIXES` if *prefixes*
is None), this function will find its :file:`site-packages` subdirectory
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
is None), this function will find its :file:`site-packages` subdirectory
is None), this function will find its site-packages subdirectory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

6 participants