update update_requirements.sh (#28002)

* simplify update_requirements.sh

* check POETRY_VIRTUALENVS_CREATE
pull/27954/head
Cameron Clough 2 years ago committed by GitHub
parent a33af9cb74
commit 16c56e644e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      update_requirements.sh

@ -50,25 +50,27 @@ pip install poetry==1.2.2
poetry config virtualenvs.prefer-active-python true --local poetry config virtualenvs.prefer-active-python true --local
POETRY_INSTALL_ARGS="" if [[ -n "$XX" ]] || [[ "$(basename "$(dirname "$(pwd)")")" == "xx" ]]; then
if [ -d "./xx" ] || [ -n "$XX" ]; then XX=true
echo "WARNING: using xx dependency group, installing globally"
poetry config virtualenvs.create false --local
POETRY_INSTALL_ARGS="--with xx --sync"
fi fi
echo "pip packages install..." POETRY_INSTALL_ARGS="--no-cache --no-root"
poetry install --no-cache --no-root $POETRY_INSTALL_ARGS
pyenv rehash
if [ -d "./xx" ] || [ -n "$POETRY_VIRTUALENVS_CREATE" ]; then if [ -n "$XX" ]; then
RUN="" echo "WARNING: using xx dependency group, installing globally"
poetry config virtualenvs.create false --local
POETRY_INSTALL_ARGS="$POETRY_INSTALL_ARGS --with xx --sync"
else else
echo "PYTHONPATH=${PWD}" > .env echo "PYTHONPATH=${PWD}" > .env
poetry self add poetry-dotenv-plugin@^0.1.0 poetry self add poetry-dotenv-plugin@^0.1.0
RUN="poetry run"
fi fi
echo "pip packages install..."
poetry install $POETRY_INSTALL_ARGS
pyenv rehash
[ -n "$XX" ] || [ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run"
if [ "$(uname)" != "Darwin" ]; then if [ "$(uname)" != "Darwin" ]; then
echo "pre-commit hooks install..." echo "pre-commit hooks install..."
shopt -s nullglob shopt -s nullglob

Loading…
Cancel
Save