Switch CI to use poetry

This commit is contained in:
Richard Bowman 2021-03-29 11:26:38 +01:00
parent 4c70562687
commit faa08f3aef

View file

@ -6,12 +6,12 @@ stages:
- deploy - deploy
# Re-usable block to install (and cache) Poetry and openflexure-microscope-server # Re-usable block to install (and cache) Poetry and openflexure-microscope-server
.poetry-install-template: &poetry-install .python-install-template: &python-install
before_script: before_script:
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - python3 -m venv .venv # NB this does not overwrite an existing cached venv
- source $HOME/.poetry/env - source .venv/bin/activate
- poetry config virtualenvs.in-project true - pip install pipenv # Should be cached after first run
- poetry install -vv - pipenv install # Should be cached after first run - will just check packages are present
cache: cache:
key: "${CI_COMMIT_REF_SLUG}" key: "${CI_COMMIT_REF_SLUG}"
paths: paths:
@ -34,7 +34,7 @@ pylint:
image: python:3.7 image: python:3.7
retry: 1 retry: 1
<<: *poetry-install <<: *python-install
script: script:
- poetry run poe pylint - poetry run poe pylint
@ -51,7 +51,7 @@ mypy:
image: python:3.7 image: python:3.7
retry: 1 retry: 1
<<: *poetry-install <<: *python-install
script: script:
- poetry run poe mypy - poetry run poe mypy
@ -73,7 +73,7 @@ black:
retry: 1 retry: 1
allow_failure: true allow_failure: true
<<: *poetry-install <<: *python-install
script: script:
# Run static build script # Run static build script
@ -91,7 +91,7 @@ pytest:
image: python:3.7 image: python:3.7
retry: 1 retry: 1
<<: *poetry-install <<: *python-install
script: script:
- poetry run poe test - poetry run poe test