actions / actions/setup-python
Update PY_PYTHON env var on windows with installed version if update-environment is true
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.2k
- 派生
- 739
- 平均合并
- 6 天 18 小时
- 30 天内合并 PR
- 1
描述
Description:
The update-environment flag updates seems to update a bunch of env variables to point at the newly installed version (cypthon example: https://github.com/actions/setup-python/blob/main/src/find-python.ts#L111).
Could it also add the PY_PYTHON=<version> on Windows whenever update-environment is true? This will make the default version for the Windows py launcher match the one requested - even if the runner has another version already installed.
Justification:
In short: make sure that py <script.py> runs on the version of python that you just installed with setup-python.
I bumped into this because we had some scripts running on a windows runner using py <script.py> in an action. The runner updated, everything broke, and we noticed that even though setup-python is installing everything correctly - if another version is there (in this case a newer version) running anything with py can use the other version instead of the one that was just installed by setup-python.
Are you willing to submit a PR?
Happy to! I just didn't want to to put time into it if the feature is not a good idea / I'm missing something. Setting the PY_PYTHON env var in the actions worked for my specific case, though I'm wondering if to do it in general it should set any other py launcher related variables to match the newly installed python too.
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 src/find-python.ts 中 issue 所引用的 update-environment 处理附近开始,跟踪 Windows 上如何更新已安装版本的环境变量。当 update-environment 也将 PY_PYTHON 设置为请求的已安装版本,使 Windows py 启动器选择该版本时,此更改即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github-actions, python, typescript
- 领域
- devops, operating-systems
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100