2020-12-05 17:36:35 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Environment setup script for the local project. Intended to be used with automation
|
|
|
|
# to create a repeatable local environment for tests to be run in. The python env
|
|
|
|
# this script creates can be accessed at the location defined by the CI_VENV variable
|
|
|
|
# below.
|
|
|
|
|
|
|
|
set -e;
|
|
|
|
|
|
|
|
CI_CACHE=$HOME/.cache;
|
2022-01-05 05:45:27 +00:00
|
|
|
POETRY_VERSION=1.1.12;
|
2020-12-05 17:36:35 +00:00
|
|
|
|
|
|
|
mkdir --parents "$CI_CACHE";
|
|
|
|
|
|
|
|
command -v python;
|
|
|
|
python --version;
|
|
|
|
|
2022-01-05 05:45:27 +00:00
|
|
|
curl --location https://install.python-poetry.org \
|
|
|
|
--output "$CI_CACHE/install-poetry.py" \
|
2020-12-05 17:36:35 +00:00
|
|
|
--silent \
|
2022-01-05 05:45:27 +00:00
|
|
|
--show-error;
|
|
|
|
python "$CI_CACHE/install-poetry.py" \
|
|
|
|
--version "$POETRY_VERSION" \
|
|
|
|
--yes;
|
2021-12-04 17:49:15 +00:00
|
|
|
poetry --version --no-ansi;
|
2022-01-05 05:45:27 +00:00
|
|
|
poetry run pip --version;
|
2020-12-05 17:36:35 +00:00
|
|
|
|
2022-01-05 05:45:27 +00:00
|
|
|
poetry install \
|
2020-12-05 17:36:35 +00:00
|
|
|
--extras poetry \
|
|
|
|
--quiet \
|
2022-01-05 05:45:27 +00:00
|
|
|
--remove-untracked \
|
|
|
|
--no-ansi;
|
2020-12-05 17:36:35 +00:00
|
|
|
|
2022-01-05 05:45:27 +00:00
|
|
|
poetry env info;
|
|
|
|
poetry run tox --version;
|