Skip to content

Commit e13bb71

Browse files
committed
Update CI configs, add 3.11 support
1 parent 74b19df commit e13bb71

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
max-parallel: 4
1919
matrix:
2020
os: [Ubuntu, MacOS, Windows]
21-
python-version: [3.7, 3.8, 3.9, "3.10"]
21+
python-version: [3.7, 3.8, 3.9, "3.10", "3.11-dev"]
2222

2323
defaults:
2424
run:
@@ -28,7 +28,7 @@ jobs:
2828
- uses: actions/checkout@v3
2929

3030
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v3
31+
uses: actions/setup-python@v4
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434

@@ -61,13 +61,25 @@ jobs:
6161
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
6262

6363
- name: Ensure cache is healthy
64-
if: steps.cache.outputs.cache-hit == 'true' && matrix.os != 'MacOS'
65-
run: timeout 10s poetry run pip --version || rm -rf .venv
64+
if: steps.cache.outputs.cache-hit == 'true'
65+
run: |
66+
# `timeout` is not available on macOS, so we define a custom function.
67+
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
68+
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
69+
timeout 10s poetry run pip --version || rm -rf .venv
70+
71+
# XXX: https://github.com/pypa/pip/issues/11352 causes random failures -- remove once fixed in a release.
72+
- name: Upgrade pip on 3.11 for macOS
73+
if: ${{ matrix.python-version == '3.11-dev' && matrix.os == 'macOS' }}
74+
run: poetry run pip install git+https://github.com/pypa/pip.git@fbb7f0b293f1d9289d8c76a556540325b9a172b2
6675

6776
- name: Install dependencies
6877
shell: bash
6978
run: poetry install
7079

80+
- name: Run mypy
81+
run: poetry run mypy
82+
7183
- name: Run pytest
7284
shell: bash
7385
run: poetry run pytest -v tests

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,30 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
13+
1314
- name: Get tag
1415
id: tag
1516
run: |
1617
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
18+
1719
- name: Set up Python 3.7
18-
uses: actions/setup-python@v1
20+
uses: actions/setup-python@v4
1921
with:
2022
python-version: 3.7
23+
2124
- name: Install dependencies
22-
run: python -m pip install --upgrade pip poetry --pre
25+
run: python -m pip install --upgrade pip poetry
26+
27+
- name: Build project
28+
run: poetry build
29+
2330
- name: Publish release to PyPI
2431
env:
2532
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
2633
run: |
27-
poetry build
2834
poetry publish
35+
2936
- name: Create Release
3037
id: create_release
3138
uses: actions/create-release@v1

0 commit comments

Comments
 (0)