feat: 3.12 support for the PositionNodeFinder #308
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', 3.11-dev, 3.12-dev, pypy2, pypy-3.6] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python --version | |
pip install -U pip | |
pip install --upgrade coveralls setuptools setuptools_scm pep517 .[tests] | |
pip install . | |
- name: Mypy testing (<3.11) | |
run: | | |
pip install mypy==0.910 | |
python -m mypy executing --exclude=executing/_position_node_finder.py | |
# fromJson because https://github.community/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213/3 | |
if: ${{ !contains(fromJson('["2.7", "pypy2", "pypy-3.6", "3.11-dev","3.12-dev"]'), matrix.python-version) }} | |
# pypy < 3.8 very doesn't work | |
# 2.7 is tested separately in mypy-py2, as we need to run mypy under Python 3.x | |
- name: Mypy testing (3.11) | |
run: | | |
pip install mypy==0.971 | |
python -m mypy executing | |
# fromJson because https://github.community/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213/3 | |
# TODO: enable typechecking for 3.12 | |
if: ${{ contains(fromJson('["3.11-dev"]'), matrix.python-version) }} | |
# only >=3.11 use _position_node_finder.py | |
- name: Test | |
env: | |
EXECUTING_SLOW_TESTS: 1 | |
run: | | |
coverage run --include=executing/executing.py --append -m pytest tests | |
coverage report -m | |
- name: Coveralls Python | |
uses: AndreMiras/coveralls-python-action@v20201129 | |
with: | |
parallel: true | |
flag-name: test-${{ matrix.python-version }} | |
coveralls_finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: AndreMiras/coveralls-python-action@v20201129 | |
with: | |
parallel-finished: true | |
# Can't run mypy on Python 2.7, but can run it in Python 2 mode | |
mypy-py2: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade setuptools setuptools_scm pep517 | |
pip install .[tests] | |
pip install mypy[python2]==0.910 | |
- name: Mypy testing for Python 2 | |
run: | | |
python -m mypy --py2 executing --exclude=executing/_position_node_finder.py |