Use install-poetry to use poetry with caching.

This commit is contained in:
george 2022-02-06 16:08:40 +00:00
parent 4800274b33
commit 7f765e83b7
No known key found for this signature in database
GPG Key ID: D30164B91DE6EEE3
3 changed files with 26 additions and 14 deletions

View File

@ -1,5 +1,5 @@
[flake8]
ignore =
ignore =
# line length is handled by black
E501,
# W503 & E203 are not PEP 8 compliant and conflicts with black
@ -9,10 +9,11 @@ ignore =
F541,
# allow bare "except"
E722
exclude =
exclude =
.git,
__pycache__,
.pytest_cache,
.venv,
static,
templates,
# migrations are generated by alembic
@ -22,4 +23,4 @@ exclude =
per-file-ignores =
# ignore unused imports in __init__
__init__.py:F401
__init__.py:F401

View File

@ -38,25 +38,34 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
- name: Install poetry
uses: snok/install-poetry@v1
with:
path: ~/.cache/poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Run caching
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install poetry==1.0.10
poetry config virtualenvs.create false
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Check formatting & linting
run: |
@ -65,7 +74,7 @@ jobs:
- name: Test with pytest
run: |
pytest
poetry run pytest
env:
GITHUB_ACTIONS_TEST: true

View File

@ -1,6 +1,8 @@
[run]
branch = True
source = .
omit =
.venv/*
[report]
fail_under = 55