Skip to content

Commit

Permalink
Merge pull request #684 from StackStorm/upgrade_venv
Browse files Browse the repository at this point in the history
Upgrade venv and pip
  • Loading branch information
Kami authored Mar 16, 2021
2 parents 9477d5c + 2a89445 commit 6e66733
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/st2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ wheelhouse: .build-runners .stamp-wheelhouse
.stamp-wheelhouse: | populate_version requirements inject-deps
cat requirements.txt
# Try to install wheels 2x in case the first one fails
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
touch $@

.build-runners:
Expand Down
4 changes: 2 additions & 2 deletions packages/st2/component.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ wheelhouse: .stamp-wheelhouse
# Install wheels into shared location
cat requirements.txt
# Try to install wheels 2x in case the first one fails
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
touch $@

bdist_wheel: .stamp-bdist_wheel
Expand Down
10 changes: 6 additions & 4 deletions packages/st2/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WHEELDIR ?= /tmp/wheelhouse
DH_VIRTUALENV_INSTALL_ROOT := /opt/stackstorm
export DH_VIRTUALENV_INSTALL_ROOT
PIP_VERSION = 20.3.3

IS_SYSTEMD = $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo true)
DEB_DISTRO := $(shell lsb_release -cs)
Expand Down Expand Up @@ -67,10 +68,11 @@ override_dh_virtualenv:
#
# NB! Use '--no-download' arg for 'virtualenv' is required,
# otherwise it downloads latest PIP version instead of bundled/pinned one.
# --force-pip-version is needed to ensure correct pip version is installed
# inside dh virtualenv
dh_virtualenv --extra-virtualenv-arg='--no-download' \
--force-pip-version='20.0.2' \
# NB! Use '--copies' else /opt/stackstorm/st2/bin/python is symlink to
# /usr/bin/pythonx rather than copy - and this breaks pack install
# which follows the path to calculate the location of the bin directory
dh_virtualenv --extra-virtualenv-arg='--copies' --extra-virtualenv-arg='--no-download' \
'--upgrade-pip-to=$(PIP_VERSION)' \
--extra-pip-arg '--find-links=$(WHEELDIR)' \
--extra-pip-arg '--no-index' --no-test

Expand Down
4 changes: 2 additions & 2 deletions rpmspec/package_venv.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

%define venv_python %{venv_bin}/python3
# https://github.com/StackStorm/st2/wiki/Where-all-to-update-pip-and-or-virtualenv
%define pin_pip %{venv_python} %{venv_bin}/pip3 install pip==20.0.2
%define pin_pip %{venv_python} %{venv_bin}/pip3 install pip==20.3.3
%define install_venvctrl python3 -m pip install venvctrl
%if 0%{?rhel} == 8
%define install_crypto %{venv_python} %{venv_bin}/pip install cryptography==2.8 --no-binary cryptography
Expand All @@ -28,7 +28,7 @@
virtualenv-3 -p python3 --no-download %{venv_dir} \
%{pin_pip} \
%{install_crypto} \
%{venv_pip} -r requirements.txt \
%{venv_pip} --use-deprecated=legacy-resolver -r requirements.txt \
%{venv_pip} . \
%{install_venvctrl} \
venvctrl-relocate --source=%{venv_dir} --destination=/%{venv_install_dir} \
Expand Down

0 comments on commit 6e66733

Please sign in to comment.