question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `pypyX.Y` for PyPy `python-version` input

See original GitHub issue

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?

  • One to create missing symlinks on older versions: #347
  • One for pypX.Y naming scheme: #349

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marko-zivic-93commented, Apr 29, 2022

Hello @mayeut I will review it today 😃

0reactions
mayeutcommented, Apr 28, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions - PyPy documentation
The simplest solution is to use virtualenv (as documented here). Then enter (activate) the virtualenv and type: pypy -mpip install xyz .
Read more >
1774094 - [wpt-sync] Sync PR 34411 - Bump actions/setup-python ...
<li>Use pypyX.Y for PyPy <code>python-version</code> input: <a href="https://github-redirect.dependabot.com/actions/setup-python/issues/349">#349</a></li>
Read more >
How to install and work with PyPy - ActiveState
Click to PIP install PyPy and work with it. Also get quick instructions to work with PyPy using Conda.
Read more >
actions/setup-python v4.0.0 on GitHub - NewReleases.io
Use pypyX.Y for PyPy python-version input : #349. Example of usage: - uses: actions/setup-python@v4 with: python-version: 'pypy3.9' # pypy-X.Y kept for ...
Read more >
Bump actions/setup-python from 3.1.0 to 4.1.0 by dependabot[bot ...
Use pypyX.Y for PyPy python-version input : #349. Example of usage: - uses: actions/setup-python@v4 with: python-version: 'pypy3.9' # pypy-X.Y kept for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found