Skip to content

Commit

Permalink
♻️ Replace poetry with pip-compile for better dependency solving
Browse files Browse the repository at this point in the history
  • Loading branch information
jemrobinson committed Jul 26, 2023
1 parent 0341848 commit ddc018f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,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
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 ddc018f

Please sign in to comment.