Skip to content

Commit 6e66733

Browse files
authored
Merge pull request #684 from StackStorm/upgrade_venv
Upgrade venv and pip
2 parents 9477d5c + 2a89445 commit 6e66733

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

packages/st2/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ wheelhouse: .build-runners .stamp-wheelhouse
130130
.stamp-wheelhouse: | populate_version requirements inject-deps
131131
cat requirements.txt
132132
# Try to install wheels 2x in case the first one fails
133-
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
134-
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
133+
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
134+
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
135135
touch $@
136136

137137
.build-runners:

packages/st2/component.makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ wheelhouse: .stamp-wheelhouse
7575
# Install wheels into shared location
7676
cat requirements.txt
7777
# Try to install wheels 2x in case the first one fails
78-
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
79-
$(PIP_BINARY) wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
78+
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt || \
79+
$(PIP_BINARY) --use-deprecated=legacy-resolver wheel --wheel-dir=$(WHEELDIR) --find-links=$(WHEELDIR) -r requirements.txt
8080
touch $@
8181

8282
bdist_wheel: .stamp-bdist_wheel

packages/st2/debian/rules

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
1111
WHEELDIR ?= /tmp/wheelhouse
1212
DH_VIRTUALENV_INSTALL_ROOT := /opt/stackstorm
1313
export DH_VIRTUALENV_INSTALL_ROOT
14+
PIP_VERSION = 20.3.3
1415

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

rpmspec/package_venv.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

0 commit comments

Comments
 (0)