Skip to content
play

GitHub Action

WIPAC Dev Py Versions

v2.5 Latest version

WIPAC Dev Py Versions

play

WIPAC Dev Py Versions

GitHub Action Package for Generating a Build Matrix of Supported Python Versions for a Package

Installation

Copy and paste the following snippet into your .yml file.

              

- name: WIPAC Dev Py Versions

uses: WIPACrepo/wipac-dev-py-versions-action@v2.5

Learn more about this action in WIPACrepo/wipac-dev-py-versions-action

Choose a version

WIPACrepo/wipac-dev-py-versions-action

GitHub Action Package for Generating a Build Matrix of Supported Python Versions for a Package

Getting Started

WIPACrepo/wipac-dev-py-versions-action produces a JSON string containing a list/matrix of supported Python versions by parsing a Python package's setup.cfg (the python_requires attribute in the [options] section).

The JSON string is contained in the output variable matrix, and its versions are stored in a JSON list. This action can then be used to create a build matrix for running tests with different python versions. Below is a simple use case, where each version is used to run pip install ..

py-versions:
  runs-on: ubuntu-latest
  outputs:
    matrix: ${{ steps.versions.outputs.matrix }}
  steps:
    - uses: actions/checkout@v3
    - id: versions
      uses: WIPACrepo/wipac-dev-py-versions-action@v2.#

pip-install:
  needs: [py-versions]
  runs-on: ubuntu-latest
  strategy:
    fail-fast: false
    matrix:
        version: ${{ fromJSON(needs.py-versions.outputs.matrix) }}
  steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v3
      with:
        python-version: ${{ matrix.version }}
    - run: |
        pip install --upgrade pip wheel setuptools
        pip install .