Skip to content

Conversation

ShaharNaveh
Copy link
Contributor

@ShaharNaveh ShaharNaveh commented Sep 7, 2025

@bedevere-app
Copy link

bedevere-app bot commented Sep 7, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

picnixz
picnixz previously requested changes Sep 7, 2025
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

  • When is it an issue?
  • Please open an issue first to discuss the rationale.

@bedevere-app
Copy link

bedevere-app bot commented Sep 7, 2025

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label Sep 7, 2025
@picnixz picnixz changed the title site._get_path to respect non-default implementation name gh-138614: site._get_path to respect non-default implementation name Sep 7, 2025
@picnixz picnixz removed the pending The issue will be closed if no feedback is provided label Sep 7, 2025
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

Please add a NEWS entry, something like:

:mod:`site`: correctly synchronize the ``purelib`` installation
scheme with the one defined in :mod:`sysconfig`.

@ShaharNaveh ShaharNaveh requested a review from picnixz September 7, 2025 09:44
Comment on lines 1 to 2
:mod:`site`: correctly synchronize the ``purelib`` installation scheme with
the one defined in :mod:`sysconfig`.
Copy link
Member

Choose a reason for hiding this comment

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

After some thoughts, what I wrote is a bit too obscure. Let's mention the public API:

Suggested change
:mod:`site`: correctly synchronize the ``purelib`` installation scheme with
the one defined in :mod:`sysconfig`.
:mod:`site`: correctly synchronize the ``purelib`` installation scheme with
the one defined in :mod:`sysconfig`. This affects the default user-specific
site-packages directory path (see :func:`site.getusersitepackages`).

Copy link
Member

Choose a reason for hiding this comment

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

Following the maintainer's feedback, you can remove the NEWS entry.

Copy link
Member

Choose a reason for hiding this comment

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

Do we have any actual user-facing downstream issues? If so, we can keep the NEWS entry (with @picnixz's proposed change), otherwise I think we should just drop it.

cc @ShaharNaveh

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

We also need to update https://docs.python.org/3/library/site.html#site.USER_SITE:

Path to the user site-packages for the running Python. Can be None if getusersitepackages() hasn’t been called yet. Default value is ~/.local/lib/pythonX.Y[t]/site-packages for UNIX and non-framework macOS builds, ~/Library/Python/X.Y/lib/python/site-packages for macOS framework builds, and %APPDATA%\Python\PythonXY\site-packages on Windows. The optional “t” indicates the free-threaded build. This directory is a site directory, which means that .pth files in it will be processed.

It shouldn't be "Python" but whatever implementation it is being used.

@picnixz
Copy link
Member

picnixz commented Sep 7, 2025

Strictly speaking, _get_implementation is hard-coded and private so it shouldn't be modifiable by end-users. Does PyPy do something here? if it's only meant to be used internally, we may not need to update the docs for now.

We do have an issue of synchronization that I'm ok to fix, but it won't be visible to end-users so we may just forget about NEWS entries. I'll wait for @FFY00 feedback.

@FFY00
Copy link
Member

FFY00 commented Oct 4, 2025

Strictly speaking, _get_implementation is hard-coded and private so it shouldn't be modifiable by end-users. Does PyPy do something here? if it's only meant to be used internally, we may not need to update the docs for now.

Yes, it is meant to be patched by other implementations, to minimize the amount patching required in the rest of the code, and help keep everything in sync.

We do have an issue of synchronization that I'm ok to fix, but it won't be visible to end-users so we may just forget about NEWS entries. I'll wait for @FFY00 feedback.

I don't think we need a NEWS entry.

Copy link
Member

@FFY00 FFY00 left a comment

Choose a reason for hiding this comment

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

@ShaharNaveh, thanks for working on this!

@ShaharNaveh
Copy link
Contributor Author

I don't think we need a NEWS entry.

Alright, will fix the PR in a bit

@ShaharNaveh ShaharNaveh requested a review from FFY00 October 4, 2025 20:07
@ShaharNaveh ShaharNaveh requested a review from picnixz October 4, 2025 20:07
@FFY00 FFY00 merged commit 744ec1d into python:main Oct 10, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

site.py hardcodes "python" instead of using {implementation_lower}

3 participants