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

View File

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

View File

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