Skip to content

Commit 05054a8

Browse files
committed
fix: get rid of broken abatilo/actions-poetry action and add retries
1 parent 9bfa4db commit 05054a8

5 files changed

Lines changed: 117 additions & 53 deletions

File tree

.github/workflows/check.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,47 @@ on:
1414
jobs:
1515
check:
1616

17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-latest
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
21+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2222
steps:
23-
- uses: actions/checkout@v2
24-
with:
25-
submodules: 'recursive'
26-
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
31-
- name: Setup poetry
32-
uses: abatilo/actions-poetry@v4
33-
with:
34-
poetry-version: '1.8.5'
35-
36-
- name: Setup a local virtual environment
37-
run: |
38-
poetry config virtualenvs.create true --local
39-
poetry config virtualenvs.in-project true --local
40-
41-
- uses: actions/cache@v3
42-
name: Define a cache for the virtual environment based on the dependencies lock file
43-
with:
44-
path: ./.venv
45-
key: venv-${{ hashFiles('poetry.lock') }}
46-
47-
- name: Install dependencies
48-
run: poetry install -E crypto
49-
- name: Generate rest sync code and tests
50-
run: poetry run unasync
51-
- name: Test with pytest
52-
run: poetry run pytest --verbose --tb=short
23+
- uses: actions/checkout@v4
24+
with:
25+
submodules: 'recursive'
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
id: setup-python
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Setup poetry
33+
run: |
34+
python3 -m pip install --user pipx
35+
python3 -m pipx ensurepath
36+
pipx install poetry==1.8.5 --python ${{ steps.setup-python.outputs.python-path }}
37+
38+
- name: Setup a local virtual environment
39+
run: |
40+
poetry config virtualenvs.create true --local
41+
poetry config virtualenvs.in-project true --local
42+
43+
- uses: actions/cache@v3
44+
name: Define a cache for the virtual environment based on the dependencies lock file
45+
id: cache
46+
with:
47+
path: ./.venv
48+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
49+
50+
- name: Ensure cache is healthy
51+
if: steps.cache.outputs.cache-hit == 'true'
52+
shell: bash
53+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
54+
55+
- name: Install dependencies
56+
run: poetry install -E crypto
57+
- name: Generate rest sync code and tests
58+
run: poetry run unasync
59+
- name: Test with pytest
60+
run: poetry run pytest --verbose --tb=short --reruns 3

.github/workflows/lint.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,42 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
with:
15-
submodules: 'recursive'
16-
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v2
18-
with:
19-
python-version: '3.8'
20-
- name: Setup poetry
21-
uses: abatilo/actions-poetry@v2.0.0
22-
with:
23-
poetry-version: 1.3.2
24-
- name: Install dependencies
25-
run: poetry install -E crypto
26-
- name: Lint with flake8
27-
run: poetry run flake8
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: 'recursive'
16+
- name: Set up Python 3.9
17+
uses: actions/setup-python@v5
18+
id: setup-python
19+
with:
20+
python-version: '3.9'
21+
- name: Setup poetry
22+
run: |
23+
python3 -m pip install --user pipx
24+
python3 -m pipx ensurepath
25+
pipx install poetry==1.8.5 --python ${{ steps.setup-python.outputs.python-path }}
26+
27+
- name: Check python version
28+
run: |
29+
poetry run python --version
30+
31+
- name: Setup a local virtual environment
32+
run: |
33+
poetry config virtualenvs.create true --local
34+
poetry config virtualenvs.in-project true --local
35+
36+
- uses: actions/cache@v3
37+
name: Define a cache for the virtual environment based on the dependencies lock file
38+
id: cache
39+
with:
40+
path: ./.venv
41+
key: venv-${{ runner.os }}-3.9-${{ hashFiles('poetry.lock') }}
42+
43+
- name: Ensure cache is healthy
44+
if: steps.cache.outputs.cache-hit == 'true'
45+
shell: bash
46+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
47+
48+
- name: Install dependencies
49+
run: poetry install
50+
- name: Lint with flake8
51+
run: poetry run flake8

poetry.lock

Lines changed: 32 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ respx = [
6969
]
7070
importlib-metadata = "^4.12"
7171
pytest-timeout = "^2.1.0"
72+
pytest-rerunfailures = [
73+
{ version = "^13.0", python = "~3.7" },
74+
{ version = "^14.0", python = "^3.8" },
75+
]
7276
async-case = { version = "^10.1.0", python = "~3.7" }
7377
tokenize_rt = "*"
7478

setup.cfg

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ ignore = W503, W504, N818
77
per-file-ignores =
88
# imported but unused
99
__init__.py: F401
10-
11-
exclude =
12-
# Exclude virtual environment check
13-
venv
14-
10+
# Exclude virtual environment check
11+
exclude = .venv,venv,env,.env,.git,__pycache__,.pytest_cache,build,dist,*.egg-info
1512

1613
[tool:pytest]
1714
#log_level = DEBUG

0 commit comments

Comments
 (0)