actions / actions/setup-python

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

未关闭
#1,115 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature request
主要语言
TypeScript
星标
2.2k
派生
739
平均合并
6 天 18 小时
30 天内合并 PR
1

描述

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.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读用于将已安装的 Python 版本标记为可用的 setup-python tool-cache 路径,然后查看链接的外部管理环境规范。确定在记录可用性之前应如何创建 marker,以及现有的哪些测试覆盖了缓存的 Python 安装。完成标准是:阻止对缓存的解释器执行全局 pip 安装,同时不影响受支持的 virtual-environment 或 uv 工作流。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, typescript
领域
ci-cd, devops, tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。