3 on: [push, pull_request]
12 python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.7"]
14 name: Python ${{ matrix.python-version }}
15 runs-on: ubuntu-latest
20 - uses: actions/checkout@v4
21 - uses: s-weigand/setup-conda@v1
23 conda-channels: conda-forge
24 python-version: ${{ matrix.python-version }}
25 if: ${{ runner.os == 'Linux' && !contains(fromJSON(env.not_in_conda), matrix.python-version) }}
26 - uses: actions/setup-python@v4
28 python-version: ${{ matrix.python-version }}
29 if: ${{ runner.os != 'Linux' || contains(fromJSON(env.not_in_conda), matrix.python-version) }}
31 uses: actions/cache@v3
33 # This path is specific to Linux/Unix
35 key: ${{ runner.os }}-pip
38 - name: Install dependencies
41 python -m pip || python -m ensurepip --default-pip --upgrade
42 python -m pip install --upgrade pip setuptools wheel
44 pip install --upgrade virtualenv "tox >= 2.0, < 4"
48 ld_library_path = None
49 if hasattr(sys, 'pypy_version_info'):
52 pyver = '%d%d' % tuple(sys.version_info[:2])
53 if os.name == 'posix':
54 if pyver == '27': # Python 2.7 on Linux requires `$LD_LIBRARY_PATH`
55 ld_library_path = os.path.join(
56 os.path.dirname(os.path.dirname(sys.executable)), 'lib')
57 toxenv = 'py%s' % pyver
58 with open(os.environ['GITHUB_ENV'], 'a') as f:
60 f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n')
61 f.write('TOXENV=' + toxenv + '\n')
64 - name: Run tox targets for ${{ matrix.python-version }}
66 python -c "import os; print(os.environ['TOXENV'])"