Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

PIP dependency resolver check #3473

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions scripts/install_python_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ source deps/env/bin/activate
PYTHON="${PWD}/deps/env/bin/python"
PIP="${PYTHON} -m pip"

# python version
PYTHON_MAJOR_VERSION=$(${PYTHON} -c 'import sys; print(sys.version_info.major)')
PYTHON_MINOR_VERSION=$(${PYTHON} -c 'import sys; print(sys.version_info.minor)')
PYTHON_VERSION="python${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION}"

# pip version
PIP_MAJOR_VERSION=$(${PYTHON} -c 'import pip; print(pip.__version__.split(".")[0])')
PIP_MINOR_VERSION=$(${PYTHON} -c 'import pip; print(pip.__version__.split(".")[1])')

# TODO - not sure why 'm' is necessary here (and not in 2.7)
# note that PYTHON_VERSION includes the word "python", like "python2.7" or "python3.6"
PYTHON_FULL_NAME=${PYTHON_VERSION}m
Expand All @@ -35,10 +40,15 @@ function linux_patch_sigfpe_handler {
}

$PIP install --upgrade "pip"
DEPS_RESOLVER_FLAG=""
if [["$PIP_MAJOR_VERSION" -lt 20 && "$PIP_MINOR_VERSION" -lt 2]]; then
DEPS_RESOLVER_FLAG="--use-feature=2020-resolver"
fi

if [[ "$USE_MINIMAL" -eq 1 ]]; then
$PIP install -r scripts/requirements-minimal.txt --prefer-binary --use-feature=2020-resolver
$PIP install -r scripts/requirements-minimal.txt --prefer-binary $DEPS_RESOLVER_FLAG
else
$PIP install -r scripts/requirements.txt --prefer-binary --use-feature=2020-resolver
$PIP install -r scripts/requirements.txt --prefer-binary $DEPS_RESOLVER_FLAG
fi

# install pre-commit hooks for git
Expand Down