Skip to content

Commit b115fe4

Browse files
committed
chore: add proper package manager
1 parent c4b6903 commit b115fe4

3 files changed

Lines changed: 985 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,31 @@ jobs:
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323

24+
- name: Install Poetry
25+
uses: snok/install-poetry@v1
26+
with:
27+
virtualenvs-create: true
28+
virtualenvs-in-project: true
29+
30+
- name: Load cached venv
31+
id: cached-poetry-dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: .venv
35+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
36+
2437
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install pytest flake8
28-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29-
pip install -e .
38+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
39+
run: poetry install --no-interaction --no-root
40+
41+
- name: Install library
42+
run: poetry install --no-interaction
3043

3144
- name: Lint with flake8
3245
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
46+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
47+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3748
3849
- name: Test with pytest
3950
run: |
40-
pytest
51+
poetry run pytest

0 commit comments

Comments
 (0)