Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to remove legacy poetry version in 5.0.6-0 rpm #2782 #2784

Merged
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
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ set -o errexit

# Install Poetry, a dependency management, packaging, and build system.
# Uninstall legacy/transitional Poetry version of 1.1.15
PATH="$HOME/.local/bin:$PATH" # account for more constrained environments.
if which poetry && poetry --version | grep -q "1.1.15"; then
echo "Poetry version 1.1.15 found - UNINSTALLING"
curl -sSL https://install.python-poetry.org | python3 - --uninstall
rm --force /root/.local/bin/poetry # remove dangling dead link.
fi
PATH="${PATH//'/root/.local/bin:'/''}" # null all legacy poetry paths
# We are run, outside of development, only by RPM's %posttrans.
# As such our .venv dir has already been removed in %post (update mode).
PATH="${PATH//'/opt/rockstor/.venv/bin:'/''}" # null now removed .venv from path.
echo "build.sh has PATH=$PATH"
# Install Poetry via PIPX as a global app
# https://peps.python.org/pep-0668/#guide-users-towards-virtual-environments
export PIPX_HOME=/opt/pipx # virtual environment location, default ~/.local/pipx
Expand All @@ -24,6 +31,7 @@ python3.11 -m pipx install poetry==1.7.1
# https://github.com/python-poetry/poetry/issues/3078
export LANG=C.UTF-8
export PYTHONIOENCODING=utf8
# /usr/local/bin/poetry -> /opt/pipx/venvs/poetry
/usr/local/bin/poetry install --no-interaction --no-ansi > poetry-install.txt 2>&1
echo

Expand Down