actions / actions/setup-python
Update PY_PYTHON env var on windows with installed version if update-environment is true
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.2k
- フォーク
- 739
- 平均マージ
- 6日 18時間
- マージ済み PR(30日)
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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