Fix caching setup for Python dependencies in CircleCI

pull/7803/head
Thibaud Colas 2021-12-02 09:13:48 +00:00 zatwierdzone przez LB (Ben Johnston)
rodzic 3651e5f21b
commit 7523d65d84
2 zmienionych plików z 12 dodań i 8 usunięć

Wyświetl plik

@ -4,17 +4,21 @@ jobs:
backend: backend:
docker: docker:
- image: cimg/python:3.8.11 - image: cimg/python:3.8.11
environment:
PIPENV_VENV_IN_PROJECT: true
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
keys: key: pipenv-v1-{{ checksum "setup.py" }}
- pip-packages-v1-{{ .Branch }} # Only install if .venv wasnt cached.
- pip-packages-v1- - run: |
- run: pipenv install -e .[testing] if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing]
fi
- save_cache: - save_cache:
key: pipenv-v1-{{ checksum "setup.py" }}
paths: paths:
- ~/.local/ - .venv
key: pip-package-v1-{{ .Branch }}
- run: pipenv run flake8 - run: pipenv run flake8
- run: pipenv run isort --check-only --diff . - run: pipenv run isort --check-only --diff .
# Filter out known false positives, while preserving normal output and error codes. # Filter out known false positives, while preserving normal output and error codes.

Wyświetl plik

@ -11,7 +11,7 @@ python-tag = py3
# W503: line break before binary operator (superseded by W504 line break after binary operator) # W503: line break before binary operator (superseded by W504 line break after binary operator)
# N806: Variable in function should be lowercase # N806: Variable in function should be lowercase
ignore = D100,D101,D102,D103,D105,E501,W503,N806 ignore = D100,D101,D102,D103,D105,E501,W503,N806
exclude = wagtail/project_template/*,node_modules,venv exclude = wagtail/project_template/*,node_modules,venv,.venv
max-line-length = 120 max-line-length = 120
[doc8] [doc8]
@ -21,7 +21,7 @@ ignore-path = _build,docs/_build
[isort] [isort]
line_length=100 line_length=100
multi_line_output=4 multi_line_output=4
skip=migrations,project_template,node_modules,.git,__pycache__,LC_MESSAGES,venv skip=migrations,project_template,node_modules,.git,__pycache__,LC_MESSAGES,venv,.venv
blocked_extensions=rst,html,js,svg,txt,css,scss,png,snap,tsx blocked_extensions=rst,html,js,svg,txt,css,scss,png,snap,tsx
known_first_party=wagtail known_first_party=wagtail
default_section=THIRDPARTY default_section=THIRDPARTY