Skip to content

Add "Externally Managed Environments" support to block global package installations via pip #1115

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

Open
ccosby opened this issue May 27, 2025 · 1 comment
Labels
feature request New feature or request to improve the current logic

Comments

@ccosby
Copy link

ccosby commented May 27, 2025

Description:
To prevent system package breakage, many Linux distributions are now restricting pip install to virtual environments or uv environments (something private either way). In self-hosted environments, especially when using ephemeral runners, the hosted tools cache functionality is critical for scaling.

The current methodology allows a pip install to install directly to the cached directory for a given Python after installation, which leads to potentially broken dependency trees and all other kinds of errors if developers are not careful with their package installs. It can also lead to weird race conditions in the same way.

I propose a new input for actions/setup-python that creates the EXTERNALLY-MANAGED file right before a version of Python is marked as available (e.g. creation of the x64.complete file) that would block global pip installs.

https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments

Justification:
Did all of this in the above. Didn't read the template first.

Are you willing to submit a PR?
Absolutely. This is more of a RFC to gauge the level of interest here.

@ccosby ccosby added feature request New feature or request to improve the current logic needs triage labels May 27, 2025
@priya-kinthali
Copy link
Contributor

Hello @ccosby👋,
Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

2 participants