Option to setup the oldest available Python rather than the latest version when a range of version specified
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- github-actions, typescript
- Domínio
- ci-cd
Direção de pesquisa
Comece rastreando como actions/setup-python resolve o intervalo de python-version e consulte o comportamento do manifesto de versões descrito na issue. Defina o comportamento esperado para uma entrada oldest-first com opt-in, incluindo as alterações na imagem do runner, e verifique se o comportamento existente de latest-version permanece inalterado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description:
Describe your proposal.
When specifying the python-version with a version range or 3.x, the latest version will be installed.
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.7 - 3.13"
- name: Lint
run: pipx run pre-commit ...
This issue requests an opt-in option to let the action install the oldest major version available on the runner rather than the latest.
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.7 - 3.13"
oldest-first: true
Justification:
Justification or a use case for your proposal.
Newer Python may introduce new syntax. The valid code that can run on the latest Python may contain syntax errors in older Python. For example, Python 3.12 supports more powerful f-strings.
$ cat test.py
lines = ['a', 'b', 'c']
string = f'The joined lines are:\n{"\n".join(lines)}'
print(string)
$ python3.12 test.py
The joined lines are:
a
b
c
$ python3.11 test.py
File "/home/PanXuehai/.../test.py", line 2
string = f'The joined lines are:\n{"\n".join(lines)}'
^
SyntaxError: f-string expression part cannot include a backslash
The linting tool may not complain about the backward incompatible code if the linter runs with the latest Python.
One solution is to pin an old Python in the CI manually. However, the GitHub-hosted runner image may be updated separately with actions/setup-python. Users cannot use:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.7"
Because the CI will break when ubuntu-latest changes from ubuntu-22.04 to ubuntu-24.04.
- The version '3.7' with architecture 'x64' was not found for Ubuntu 24.04.
- The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
This request reduces the potential CI breakage for the two cases above.
Are you willing to submit a PR?
- Linguagem predominante
- TypeScript
- Estrelas
- 2.2k
- Forks
- 739
- Merge médio
- 6d 18h
- PRs com merge (30d)
- 1
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de actions/setup-python
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
actions/setup-python#1348 · 5 comentários ·
-
feature request
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
actions/setup-python#1346 · 12 comentários ·
-
feature request
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
actions/setup-python#1308 · 8 comentários ·
-
feature request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
actions/setup-python#1301 · 5 comentários ·
-
feature request
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
actions/setup-python#1294 · 3 comentários · 2 reações ·
Todas as issues de actions/setup-python
Issues semelhantes
-
blocklist removal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
pastelsky/bundlephobia#1122 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100