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 re-create venv - pre 5.0.3-0 updating to 5.0.6-0 rpm #2788 #2790

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
24 changes: 18 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,38 @@ 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).
echo "Unset VIRTUAL_ENV"
# Redundant when updating from rockstor 5.0.3-0 onwards: src/rockstor/system/pkg_mgmt.py
unset VIRTUAL_ENV
PATH="${PATH//'/opt/rockstor/.venv/bin:'/''}" # null now removed .venv from path.

echo "build.sh has PATH=$PATH"
echo
# Establish LANG from install.
source /etc/locale.conf
echo "Adopting installs' LANG=${LANG}"

# Install Poetry via PIPX as a global app
# https://peps.python.org/pep-0668/#guide-users-towards-virtual-environments
# https://pipx.pypa.io/stable/installation/
export PIPX_HOME=/opt/pipx # virtual environment location, default ~/.local/pipx
export PIPX_BIN_DIR=/usr/local/bin # binary location for pipx-installed apps, default ~/.local/bin
python3.11 -m pipx install poetry==1.7.1
export PIPX_MAN_DIR=/usr/local/share/man # manual page location for pipx-installed apps, default ~/.local/share/man
# https://python-poetry.org/docs/#installing-with-pipx
pipx ensurepath
pipx install --python python3.11 poetry==1.7.1
pipx list

# Install project dependencies defined in cwd pyproject.toml using poetry.toml
# specific configuration, i.e. virtualenv in cwd/.venv
# /opt/rockstor/.venv
# poetry env remove --all # removes all venvs associated with a pyproject.toml
# rm -rf ~/.cache/pypoetry/virtualenvs/* # to delete default location venvs.
# ** --no-ansi avoids special characters **
# Resolve Python 3.6 Poetry issue re char \u2022: (bullet)
# https://github.com/python-poetry/poetry/issues/3078
export LANG=C.UTF-8
export PYTHONIOENCODING=utf8
env > poetry-install.txt
poetry --version >> poetry-install.txt
# /usr/local/bin/poetry -> /opt/pipx/venvs/poetry
/usr/local/bin/poetry install --no-interaction --no-ansi > poetry-install.txt 2>&1
poetry install -vvv --no-interaction --no-ansi >> poetry-install.txt 2>&1
echo

# Add js libs. See: https://github.com/rockstor/rockstor-jslibs
Expand Down