Skip to content

gh-90982: document prefixes argument on site.getsitepackages - #31546

Merged
serhiy-storchaka merged 8 commits into
python:mainfrom
asnelling:issue46826
Aug 12, 2026
Merged

gh-90982: document prefixes argument on site.getsitepackages#31546
serhiy-storchaka merged 8 commits into
python:mainfrom
asnelling:issue46826

Conversation

@asnelling

@asnelling asnelling commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

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
Comment thread Doc/library/site.rst Outdated
@@ -0,0 +1 @@
document prefixes argument on site.getsitepackages

@slateny slateny Oct 2, 2022

Copy link
Copy Markdown
Contributor

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

slateny commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread Doc/library/site.rst Outdated
Comment thread Doc/library/site.rst Outdated
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
Copy Markdown
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

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 10, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34018860 | 📁 Comparing 7110714 against main (3444ef9)

  🔍 Preview build  

2 files changed
± library/site.html
± whatsnew/changelog.html

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Aug 12, 2026
@serhiy-storchaka serhiy-storchaka changed the title bpo-46826: document prefixes argument on site.getsitepackages gh-90982: document prefixes argument on site.getsitepackages Aug 12, 2026
serhiy-storchaka and others added 3 commits August 12, 2026 22:01
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Applied suggestions, removed NEWS, fixed other errors. LGTM now.

@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 12, 2026 19:12
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Aug 12, 2026
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 12, 2026
@serhiy-storchaka
serhiy-storchaka merged commit bc31217 into python:main Aug 12, 2026
56 of 60 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Aug 12, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @asnelling for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Aug 12, 2026

Copy link
Copy Markdown

GH-155643 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 12, 2026
@bedevere-app

bedevere-app Bot commented Aug 12, 2026

Copy link
Copy Markdown

GH-155644 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 12, 2026
@bedevere-app

bedevere-app Bot commented Aug 12, 2026

Copy link
Copy Markdown

GH-155645 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Aug 12, 2026
Comment thread Doc/library/site.rst
.. versionadded:: 3.2

.. versionchanged:: 3.3
Add the optional *prefixes* argument.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Add the optional *prefixes* argument.
Add the optional *prefixes* parameter.

Little too late.

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

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants