Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pypyX.Y for PyPy python-version input #346

Closed
mayeut opened this issue Mar 5, 2022 · 6 comments · Fixed by #349
Closed

Use pypyX.Y for PyPy python-version input #346

mayeut opened this issue Mar 5, 2022 · 6 comments · Fixed by #349
Labels
feature request New feature or request to improve the current logic

Comments

@mayeut
Copy link
Contributor

mayeut commented Mar 5, 2022

Description:
Use pypyX.Y rather than pypy-X.Y for python-version input
Still allow pypy-X.Y for backward compatibility, maybe deprecate its usage ?

Justification:
This allows python-version to match an actual executable name (c.f. note 1) and allows nox (& probably tox too) to directly use python-version to narrow environment to be tested in a matrix job.

It matches actual PyPy archive names e.g. pypy3.9-v7.3.8-linux64.tar.bz2, pypy2.7-v7.3.8-linux64.tar.bz2, ...

It would also be more in sync with virtualenv python discovery which states:

{python implementation name}{version}{architecture}
We have the following restrictions:
the python implementation is all alphabetic characters (python means any implementation, and if is missing it defaults to python),
the version is a dot separated version number,
the architecture is either -64 or -32 (missing means any).

The current way to get this result involves removing the - which is not something workflow expressions currently allows & thus involves some bash magic to happen:

jobs:
  test:
    name: ${{ matrix.os }} / ${{ matrix.python_version }}
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: [Ubuntu, Windows, macOS]
        python_version:
          ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8", "pypy-3.9"]
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python_version }}
      - run: |
          INTERPRETER_SPEC=${{ matrix.python_version }}
          INTERPRETER_SPEC=${INTERPRETER_SPEC/-/}  # remove '-' in "pypy-3.x" -> "pypy3.x" to match executable name
          pipx run nox --error-on-missing-interpreters -s tests-${INTERPRETER_SPEC}
        shell: bash

It would allow to rewrite the workflow as:

jobs:
  test:
    name: ${{ matrix.os }} / ${{ matrix.python_version }}
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: [Ubuntu, Windows, macOS]
        python_version:
          ["3.7", "3.8", "3.9", "3.10", "pypy3.7", "pypy3.8", "pypy3.9"]
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python_version }}
      - run: pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }}

Note 1: Windows is missing those executables for 3.7 & 3.8 for now but they will be available in PyPy 7.3.9

Are you willing to submit a PR?

@mayeut mayeut added feature request New feature or request to improve the current logic needs triage labels Mar 5, 2022
mayeut added a commit to mayeut/setup-python that referenced this issue Mar 5, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Mar 5, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Mar 5, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
@mayeut mayeut changed the title Allow pypyX.Y for python-version input Use pypyX.Y for python-version input Mar 5, 2022
@mayeut mayeut changed the title Use pypyX.Y for python-version input Use pypyX.Y for PyPy python-version input Mar 5, 2022
mayeut added a commit to mayeut/setup-python that referenced this issue Mar 5, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
@marko-zivic-93
Copy link
Contributor

Hello @mayeut
Thank you for your report!
We will consider this feature request and get back to you when we have some updates on the issue.

@marko-zivic-93
Copy link
Contributor

Hello @mayeut
We have considered this feature and are eager to make it a part of this repository.
If you are willing to contribute, please feel free to create a PR with this functionality and we will gladly review it and add it. If you have any questions or concerns, please contact us.

mayeut added a commit to mayeut/setup-python that referenced this issue Apr 2, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Apr 2, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Apr 2, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Apr 2, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
@mayeut
Copy link
Contributor Author

mayeut commented Apr 2, 2022

If you are willing to contribute, please feel free to create a PR with this functionality and we will gladly review it and add it. If you have any questions or concerns, please contact us.

@marko-zivic-93, PR are already created and linked in the description. I'm waiting for PyPy 7.3.9 rollout on GHA to get them out of draft.

mayeut added a commit to mayeut/setup-python that referenced this issue Apr 9, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Apr 9, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
@mayeut
Copy link
Contributor Author

mayeut commented Apr 9, 2022

@marko-zivic-93, #347 is ready for review.

mayeut added a commit to mayeut/setup-python that referenced this issue Apr 15, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue Apr 15, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
brcrista pushed a commit that referenced this issue Apr 28, 2022
`pypyX.Y.exe` executables are missing from PyPy archives on Windows before v7.3.9 (X.Y < 3.9)
`pypy2.7` symlinks are also missing from macOS/Linux PyPy archives before v7.3.9

relates to #346
mayeut added a commit to mayeut/setup-python that referenced this issue Apr 28, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
@mayeut
Copy link
Contributor Author

mayeut commented Apr 28, 2022

@marko-zivic-93, #349 is now ready for review.

@marko-zivic-93
Copy link
Contributor

Hello @mayeut
I will review it today :)

mayeut added a commit to mayeut/setup-python that referenced this issue May 7, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue May 7, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue May 7, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
mayeut added a commit to mayeut/setup-python that referenced this issue May 7, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes actions#346
vsafonkin pushed a commit that referenced this issue May 18, 2022
This versioning scheme is consistent with other
tools in the python ecosystem so it feels more natural
and allows better interaction with other tools.

fixes #346
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants