Skip to content

Commit 8818533

Browse files
committed
Fix quality workflow for poetry
1 parent d6f3faf commit 8818533

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

.github/workflows/check_code_quality.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,33 @@ jobs:
2626
runs-on: ${{ matrix.os }}
2727
steps:
2828
- uses: actions/checkout@v2
29-
- name: Setup Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v2.2.2
3131
with:
3232
python-version: ${{ matrix.python-version }}
33-
- name: Create and start a virtual environment
34-
run: |
35-
python -m venv venv
36-
source venv/bin/activate
33+
34+
- name: Install poetry
35+
run: curl -sSL https://install.python-poetry.org | python3 -
36+
37+
- name: Set up cache
38+
uses: actions/cache@v2.1.6
39+
with:
40+
path: .venv
41+
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
42+
3743
- name: Install dependencies
3844
run: |
39-
source venv/bin/activate
40-
pip install --upgrade pip
41-
pip install .[quality]
42-
pip install .[tests]
45+
poetry config virtualenvs.in-project true
46+
poetry install --with quality,tests
47+
4348
- name: Check formatting with mypy
4449
run: |
45-
source venv/bin/activate
46-
pip install types-requests
47-
mypy --strict .
50+
poetry run mypy --strict .
51+
4852
- name: Check style with black
4953
run: |
50-
source venv/bin/activate
51-
black --check .
54+
poetry run black --check .
55+
5256
- name: Check style with ruff
5357
run: |
54-
source venv/bin/activate
55-
ruff .
58+
poetry run ruff .

0 commit comments

Comments
 (0)