3 on: [push, pull_request]
10 os: [ubuntu-latest, macos-latest, windows-latest]
11 python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
15 pip-cache-path: ~/.cache/pip
18 pip-cache-path: ~/Library/Caches/pip
21 pip-cache-path: ~\AppData\Local\pip\Cache
23 name: Python ${{ matrix.python-version }} @ ${{ matrix.os-name }}
24 runs-on: ${{ matrix.os }}
29 - uses: actions/checkout@v2
30 - uses: s-weigand/setup-conda@v1
32 python-version: ${{ matrix.python-version }}
33 if: ${{ runner.os == 'Linux' && matrix.python-version != '3.11' }}
34 - uses: actions/setup-python@v4
36 python-version: ${{ matrix.python-version }}
37 if: ${{ runner.os != 'Linux' || matrix.python-version == '3.11' }}
39 uses: actions/cache@v3
41 path: ${{ matrix.pip-cache-path }}
42 key: ${{ runner.os }}-pip
45 - name: Install dependencies
48 python -m pip install --upgrade pip setuptools wheel
50 pip install --upgrade virtualenv tox
54 ld_library_path = None
55 pyver = '%d%d' % tuple(sys.version_info[:2])
56 toxenv = 'py%s-sqlite' % pyver
57 if os.name == 'posix':
58 if pyver == '27': # Python 2.7 on Linux requires `$LD_LIBRARY_PATH`
59 ld_library_path = os.path.join(
60 os.path.dirname(os.path.dirname(sys.executable)), 'lib')
61 toxenv += ',py%s-flake8' % pyver
64 with open(os.environ['GITHUB_ENV'], 'a') as f:
66 f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n')
67 f.write('TOXENV=' + toxenv + '\n')
72 python -c "import os; print(os.environ['TOXENV'])"