actions / actions/setup-python
Update PY_PYTHON env var on windows with installed version if update-environment is true
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.2k
- Forks
- 739
- Merge medio
- 6 d 18 h
- PR fusionados (30 d)
- 1
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en src/find-python.ts, alrededor del manejo de update-environment mencionado en el issue, y sigue cómo se actualizan las variables de entorno de las versiones instaladas en Windows. El cambio estará completo cuando update-environment también establezca PY_PYTHON en la versión instalada solicitada, para que el lanzador py de Windows la seleccione.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- github-actions, python, typescript
- Área
- devops, operating-systems
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100