2022-04-08 05:44:50 +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.
|
2023-03-29 22:46:57 +00:00
|
|
|
#
|
|
|
|
# POETRY_VERSION can be set to install a specific version of Poetry
|
2022-04-08 05:44:50 +00:00
|
|
|
|
|
|
|
set -e;
|
|
|
|
|
|
|
|
CI_CACHE=$HOME/.cache;
|
2023-03-29 22:46:57 +00:00
|
|
|
INSTALL_POETRY_VERSION="${POETRY_VERSION:-1.3.2}";
|
2022-04-08 05:44:50 +00:00
|
|
|
|
|
|
|
mkdir --parents "$CI_CACHE";
|
|
|
|
|
|
|
|
command -v python;
|
2024-03-21 22:28:27 +00:00
|
|
|
python3.10 --version;
|
2022-04-08 05:44:50 +00:00
|
|
|
|
|
|
|
curl --location https://install.python-poetry.org \
|
|
|
|
--output "$CI_CACHE/install-poetry.py" \
|
|
|
|
--silent \
|
|
|
|
--show-error;
|
|
|
|
python "$CI_CACHE/install-poetry.py" \
|
2023-03-29 22:46:57 +00:00
|
|
|
--version "$INSTALL_POETRY_VERSION" \
|
2022-04-08 05:44:50 +00:00
|
|
|
--yes;
|
|
|
|
poetry --version --no-ansi;
|
|
|
|
poetry run pip --version;
|
|
|
|
|
|
|
|
poetry install \
|
2023-03-02 22:03:20 +00:00
|
|
|
--sync \
|
|
|
|
--no-ansi \
|
2023-03-29 23:10:31 +00:00
|
|
|
--no-root \
|
2023-03-02 22:03:20 +00:00
|
|
|
--only ci;
|
2022-04-08 05:44:50 +00:00
|
|
|
|
|
|
|
poetry env info;
|
|
|
|
poetry run tox --version;
|