Skip to content

Commit 9745ce7

Browse files
authored
Fix and clean up CI script (#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 dc3a23b commit 9745ce7

1 file changed

Lines changed: 28 additions & 12 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

0 commit comments

Comments
 (0)