Skip to content

Commit 9f0f1b6

Browse files
authored
Fix and clean up CI script (python#876)
* Split Python 2.7 tests from Python 3 tests as they use different paths and require installation of the typing module. * Split running typing and typing_extensions tests into two steps. * Don't test typing on Python 3 * Remove pytest-xdist and pytest-cov not necessary here
1 parent 829eb41 commit 9f0f1b6

2 files changed

Lines changed: 30 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,38 @@ permissions:
88
contents: read
99

1010
jobs:
11+
tests-27:
12+
name: Run tests (2.7)
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 2.7
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r test-requirements.txt
27+
28+
- name: Test typing
29+
run: pytest python2
30+
31+
- name: Test typing_extensions
32+
run: |
33+
pip install typing
34+
pytest typing_extensions/src_py2
35+
1136
tests:
1237
name: Run tests
1338

1439
strategy:
1540
fail-fast: false
1641
matrix:
17-
# Python 3.4 disabled, due to problems with GitHub Actions.
18-
python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6, 3.5, 2.7]
42+
python-version: [3.10-dev, 3.9, 3.8, 3.7, 3.6]
1943

2044
runs-on: ubuntu-latest
2145

@@ -40,16 +64,8 @@ jobs:
4064
pip install --upgrade pip
4165
pip install -r test-requirements.txt
4266
43-
- name: Run tests
44-
env:
45-
PYTHON_VERSION: ${{ matrix.python-version }}
46-
run: |
47-
export PYTHONPATH=`python -c "import sys; print('python2' if sys.version.startswith('2') else 'src')"`
48-
if [[ $PYTHON_VERSION < '3.7' ]]; then pytest $PYTHONPATH; fi
49-
50-
if [[ $PYTHON_VERSION < '3.5' ]]; then pip install -U .; fi
51-
export PYTHONPATH=`python -c "import sys; print('typing_extensions/src_py2' if sys.version.startswith('2') else 'typing_extensions/src_py3')"`
52-
pytest $PYTHONPATH
67+
- name: Test typing_extensions
68+
run: pytest typing_extensions/src_py3
5369

5470
linting:
5571
name: Lint

test-requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
flake8; python_version >= '3.6'
22
flake8-bugbear; python_version >= '3.6'
33
flake8-pyi; python_version >= '3.6'
4-
pytest==4.6.11
5-
pytest-xdist>=1.18; python_version >= '3.4'
6-
pytest-cov>=2.4.0; python_version >= '3.4'
4+
pytest==4.6.11; python_version < '3.0'
5+
pytest; python_version >= '3.0'

0 commit comments

Comments
 (0)