Skip to content

Commit 06f7360

Browse files
authored
Minor improvements to CI workflows (#201)
- Use the new `allow-prereleases` key for `actions/setup-python`. If we set this to `true`, then we can just use `3.12` in our CI matrix, instead of `3.12-dev`. That means we won't have to worry about updating the matrix from `3.12-dev` to `3.12` when 3.12.0 comes out in the autumn; our CI will automatically start using the latest version of Python 3.12. - Colorise the output of flake8. - Don't bother upgrading pip in CI. It's not really necessary, and wastes a few seconds. Disable the "you're using an older version of pip" message instead, using the `PIP_DISABLE_PIP_VERSION_CHECK` environment variable.
1 parent 5d51455 commit 06f7360

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/ci.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
permissions:
1111
contents: read
1212

13+
env:
14+
PIP_DISABLE_PIP_VERSION_CHECK: 1
15+
1316
concurrency:
1417
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1518
cancel-in-progress: true
@@ -25,7 +28,7 @@ jobs:
2528
# Python version, because typing sometimes changed between bugfix releases.
2629
# For available versions, see:
2730
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
28-
python-version: ["3.7", "3.7.1", "3.8", "3.8.0", "3.9", "3.9.0", "3.10", "3.10.0", "3.11", "3.11.0", "3.12-dev", "pypy3.9"]
31+
python-version: ["3.7", "3.7.1", "3.8", "3.8.0", "3.9", "3.9.0", "3.10", "3.10.0", "3.11", "3.11.0", "3.12", "pypy3.9"]
2932

3033
runs-on: ubuntu-20.04
3134

@@ -36,9 +39,10 @@ jobs:
3639
uses: actions/setup-python@v4
3740
with:
3841
python-version: ${{ matrix.python-version }}
42+
allow-prereleases: true
3943

4044
- name: Test typing_extensions
41-
continue-on-error: ${{ matrix.python-version == '3.12-dev' }}
45+
continue-on-error: ${{ matrix.python-version == '3.12' }}
4246
run: |
4347
# Be wary of running `pip install` here, since it becomes easy for us to
4448
# accidentally pick up typing_extensions as installed by a dependency
@@ -61,14 +65,13 @@ jobs:
6165

6266
- name: Install dependencies
6367
run: |
64-
pip install --upgrade pip
6568
pip install -r test-requirements.txt
6669
# not included in test-requirements.txt as it depends on typing-extensions,
6770
# so it's a pain to have it installed locally
6871
pip install flake8-noqa
6972
7073
- name: Lint implementation
71-
run: flake8
74+
run: flake8 --color always
7275

7376
- name: Lint tests
74-
run: flake8 --config=.flake8-tests src/test_typing_extensions.py
77+
run: flake8 --config=.flake8-tests src/test_typing_extensions.py --color always

0 commit comments

Comments
 (0)