Update PY_PYTHON env var on windows with installed version if update-environment is true
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- github-actions, python, typescript
- Ambito
- devops, operating-systems
Direzione di ricerca
Inizia in src/find-python.ts, nella parte relativa alla gestione di update-environment menzionata nell’issue, e segui come vengono aggiornate in Windows le variabili d’ambiente delle versioni installate. La modifica è completa quando update-environment imposta anche PY_PYTHON sulla versione installata richiesta, in modo che il launcher py di Windows la selezioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2.2k
- Fork
- 739
- Merge medio
- 6g 18h
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di actions/setup-python
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
actions/setup-python#1348 · 5 commenti ·
-
feature request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
actions/setup-python#1346 · 12 commenti ·
-
feature request
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
actions/setup-python#1308 · 8 commenti ·
-
feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
actions/setup-python#1301 · 5 commenti ·
-
feature request
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
actions/setup-python#1294 · 3 commenti · 2 reazioni ·
Tutte le issue di actions/setup-python
Issue simili
-
blocklist removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pastelsky/bundlephobia#1122 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100