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

python: mark as externally managed #129943

Closed

Conversation

SMillerDev
Copy link
Member

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

See https://github.com/orgs/Homebrew/discussions/3404 for context

@github-actions github-actions bot added autosquash Automatically squash pull request commits according to Homebrew style. CI-linux-self-hosted Build on Linux self-hosted runner labels May 2, 2023
@carlocab
Copy link
Member

carlocab commented May 2, 2023

autosquash Automatically squash pull request commits according to Homebrew style. ? Odd.

@@ -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
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
(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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@Bo98 Bo98 May 4, 2023

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.

@carlocab carlocab added CI-skip-dependents Pass --skip-dependents to brew test-bot. and removed CI-linux-self-hosted Build on Linux self-hosted runner labels May 2, 2023
@github-actions github-actions bot added the CI-linux-self-hosted Build on Linux self-hosted runner label May 2, 2023
@carlocab
Copy link
Member

carlocab commented May 2, 2023

autosquash Automatically squash pull request commits according to Homebrew style. ? Odd.

Ah. Commit needs to be python@3.11: ... and not just python: ....

@carlocab carlocab removed the CI-linux-self-hosted Build on Linux self-hosted runner label May 2, 2023
@Bo98
Copy link
Member

Bo98 commented May 4, 2023

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:

In particular, we strongly recommend that distros with a concept of major versions only add the marker file or change sysconfig schemes in a new major version; otherwise there is a risk that, on an existing system, software installed via a Python-specific package manager now becomes unmanageable (without an override option). For a rolling-release distro, if possible, only add the marker file or change sysconfig schemes in a new Python minor version.

@carlocab
Copy link
Member

carlocab commented May 4, 2023

I'm wondering whether we should hold on this until 3.12

Sounds good to me.

@Bo98
Copy link
Member

Bo98 commented May 4, 2023

People may have already installed system-level packages

Just to add: it appears this also blocks pip install --user as well.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale No recent activity label May 26, 2023
@SMillerDev SMillerDev closed this May 30, 2023
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosquash Automatically squash pull request commits according to Homebrew style. CI-skip-dependents Pass --skip-dependents to brew test-bot. outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants