Skip to content

Commit

Permalink
Merge pull request #1514 from alan-turing-institute/update-package-re…
Browse files Browse the repository at this point in the history
…solution

Use pip-compile for package resolution
  • Loading branch information
edwardchalstrey1 authored Aug 1, 2023
2 parents 0341848 + b176e94 commit 6e59651
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ write_files:
content: |
{{packages-python.yaml}}
- path: "/opt/build/pyenv/pyproject_template.toml"
permissions: "0400"
content: |
{{pyenv_pyproject_template.toml}}
- path: "/opt/build/rstudio.debinfo"
permissions: "0400"
content: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ write_files:
content: |
{{packages-python.yaml}}
- path: "/opt/build/pyenv/pyproject_template.toml"
permissions: "0400"
content: |
{{pyenv_pyproject_template.toml}}
- path: "/opt/build/rstudio.debinfo"
permissions: "0400"
content: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ write_files:
content: |
{{packages-python.yaml}}
- path: "/opt/build/pyenv/pyproject_template.toml"
permissions: "0400"
content: |
{{pyenv_pyproject_template.toml}}
- path: "/opt/build/rbase.debinfo"
permissions: "0400"
content: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if [ $# -ne 1 ]; then
fi
PYTHON_VERSION=$1
PYENV_ROOT="$(pyenv root)"
PYPROJECT_TOML="/opt/build/python-${PYTHON_VERSION}-pyproject.toml"
MONITORING_LOG="/opt/monitoring/python-${PYTHON_VERSION}-package-versions.log"
REQUIREMENTS_TXT="/opt/build/python-${PYTHON_VERSION}-requirements.txt"
REQUESTED_PACKAGE_LIST="/opt/build/packages/packages-python-${PYTHON_VERSION}.list"
Expand All @@ -27,24 +26,19 @@ echo "Installed $(${EXE_PATH}/python --version)"
# Install and upgrade installation prerequisites
# ----------------------------------------------
echo "Installing and upgrading installation prerequisites for Python ${PYTHON_VERSION}..."
${EXE_PATH}/pip install --upgrade pip poetry
${EXE_PATH}/pip install --upgrade pip pip-tools setuptools


# Solve dependencies and install using poetry
# -------------------------------------------
echo "Installing packages with poetry..."
${EXE_PATH}/poetry config virtualenvs.create false
${EXE_PATH}/poetry config virtualenvs.in-project true
rm poetry.lock pyproject.toml 2> /dev/null
sed -e "s/PYTHON_VERSION/$PYTHON_VERSION/" /opt/build/pyenv/pyproject_template.toml > $PYPROJECT_TOML
ln -s $PYPROJECT_TOML pyproject.toml
${EXE_PATH}/poetry add $(tr '\n' ' ' < $REQUIREMENTS_TXT) || exit 3
# Solve dependencies and write package versions to monitoring log
# ---------------------------------------------------------------
echo "Determining package versions with pip-compile..."
${EXE_PATH}/pip-compile -o "$MONITORING_LOG" "$REQUIREMENTS_TXT"


# Write package versions to monitoring log
# ----------------------------------------
${EXE_PATH}/poetry show > $MONITORING_LOG
${EXE_PATH}/poetry show --tree >> $MONITORING_LOG
# Install pinned packages using pip
# ---------------------------------
echo "Installing packages with pip..."
${EXE_PATH}/pip install -r "$MONITORING_LOG"


# Run any post-install commands
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ packages:
pathos:
pg8000:
Pillow:
pip-tools:
plotly:
poetry: # also used by installation scripts
"all": [">1.0.0"] # increase solver flexibility
prophet:
psycopg2:
pydot:
Expand Down

0 comments on commit 6e59651

Please sign in to comment.