-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
python: mark as externally managed #129943
python: mark as externally managed #129943
Conversation
autosquash
|
@@ -331,6 +331,22 @@ def install | |||
}.each do |short_name, long_name| | |||
(libexec/"bin").install_symlink (bin/long_name).realpath => short_name | |||
end | |||
|
|||
# Mark Homebrew python as externally managed: https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager | |||
(HOMEBREW_PREFIX/"lib/python#{version.major_minor}/EXTERNALLY-MANAGED").write <<~EOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(HOMEBREW_PREFIX/"lib/python#{version.major_minor}/EXTERNALLY-MANAGED").write <<~EOS | |
(site_packages/"EXTERNALLY-MANAGED").write <<~EOS |
Though I think you may actually need site_packages_cellar
here? Not sure. @Bo98 might know more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if you're writing directly to HOMEBREW_PREFIX
then I think this needs to be in post_install
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, wasn't sure about the location here. I just ended up going with the closest equivalent of upstream docs, but maybe shipping it in the Cellar is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib_cellar
looks correct here rather than site-packages, based on the documentation that it searches stdlib
.
Ah. Commit needs to be |
I'm wondering whether we should hold on this until 3.12. People may have already installed system-level packages and this could break that. This is also acknowledged in the documentation:
|
Sounds good to me. |
Just to add: it appears this also blocks |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?See https://github.com/orgs/Homebrew/discussions/3404 for context