• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Test and lint
2
3on:
4  push:
5  pull_request:
6
7permissions:
8  contents: read
9
10jobs:
11  tests:
12    name: Run tests
13
14    strategy:
15      fail-fast: false
16      matrix:
17        # We try to test on the earliest available bugfix release of each
18        # Python version, because typing sometimes changed between bugfix releases.
19        # For available versions, see:
20        # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
21        python-version: ["3.7", "3.7.1", "3.8", "3.8.0", "3.9", "3.9.0", "3.10", "3.10.0", "3.11-dev"]
22
23    runs-on: ubuntu-latest
24
25    steps:
26      - uses: actions/checkout@v2
27
28      - name: Set up Python
29        uses: actions/setup-python@v2
30        with:
31          python-version: ${{ matrix.python-version }}
32
33      - name: Test typing_extensions
34        continue-on-error: ${{ matrix.python-version == '3.11-dev' }}
35        run: |
36          # Be wary of running `pip install` here, since it becomes easy for us to
37          # accidentally pick up typing_extensions as installed by a dependency
38          cd typing_extensions/src
39          python -m unittest test_typing_extensions.py
40
41  linting:
42    name: Lint
43
44    runs-on: ubuntu-latest
45
46    steps:
47      - uses: actions/checkout@v2
48      - name: Set up Python 3
49        uses: actions/setup-python@v2
50        with:
51          python-version: 3
52          cache: "pip"
53          cache-dependency-path: "test-requirements.txt"
54
55      - name: Install dependencies
56        run: |
57          pip install --upgrade pip
58          pip install -r test-requirements.txt
59
60      - name: Lint implementation
61        run: flake8
62
63      - name: Lint tests
64        run: flake8 --config=.flake8-tests typing_extensions/src/test_typing_extensions.py
65