Skip to content

Commit d11bc0e

Browse files
committed
Virtualenvs created by python3 itself don't have a pip executable installed, so use the pip module to install packages
1 parent 5b84068 commit d11bc0e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ flake8: requirements .flake8
395395
# NOTE We need to upgrade setuptools to avoid bug with dependency resolving in old versions
396396
# Setuptools 42 added support for python_requires, which is used by the configparser package,
397397
# which is required by the importlib-metadata package
398-
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
399-
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "setuptools==44.1.0"
398+
$(VIRTUALENV_ST2CLIENT_DIR)/bin/python -m pip install --upgrade "pip==$(PIP_VERSION)"
399+
$(VIRTUALENV_ST2CLIENT_DIR)/bin/python -m pip install --upgrade "setuptools==44.1.0"
400400

401401
$(VIRTUALENV_ST2CLIENT_DIR)/bin/activate; cd st2client ; ../$(VIRTUALENV_ST2CLIENT_DIR)/bin/python setup.py install ; cd ..
402402
$(VIRTUALENV_ST2CLIENT_DIR)/bin/st2 --version
@@ -500,9 +500,9 @@ distclean: clean
500500

501501
.PHONY: .requirements
502502
.requirements: virtualenv
503-
$(VIRTUALENV_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
503+
$(VIRTUALENV_DIR)/bin/python -m pip install --upgrade "pip==$(PIP_VERSION)"
504504
# Print out pip version
505-
$(VIRTUALENV_DIR)/bin/pip --version
505+
$(VIRTUALENV_DIR)/bin/python -m pip --version
506506
# Generate all requirements to support current CI pipeline.
507507
$(VIRTUALENV_DIR)/bin/python scripts/fixate-requirements.py --skip=virtualenv,virtualenv-osx -s st2*/in-requirements.txt contrib/runners/*/in-requirements.txt -f fixed-requirements.txt -o requirements.txt
508508

@@ -525,23 +525,23 @@ requirements: virtualenv .requirements .sdist-requirements install-runners insta
525525
@echo
526526
# setuptools >= 41.0.1 is required for packs.install in dev envs
527527
# setuptools >= 42 is required so setup.py install respects dependencies' python_requires
528-
$(VIRTUALENV_DIR)/bin/pip install --upgrade "setuptools==44.1.0"
529-
$(VIRTUALENV_DIR)/bin/pip install --upgrade "pbr==5.4.3" # workaround for pbr issue
528+
$(VIRTUALENV_DIR)/bin/python -m pip install --upgrade "setuptools==44.1.0"
529+
$(VIRTUALENV_DIR)/bin/python -m pip install --upgrade "pbr==5.4.3" # workaround for pbr issue
530530

531531
# Fix for Travis CI race
532-
$(VIRTUALENV_DIR)/bin/pip install "six==1.12.0"
532+
$(VIRTUALENV_DIR)/bin/python -m pip install "six==1.12.0"
533533

534534
# Fix for Travis CI caching issue
535535
if [[ "$(TRAVIS_EVENT_TYPE)" != "" ]]; then\
536-
$(VIRTUALENV_DIR)/bin/pip uninstall -y "pytz" || echo "not installed"; \
537-
$(VIRTUALENV_DIR)/bin/pip uninstall -y "python-dateutil" || echo "not installed"; \
538-
$(VIRTUALENV_DIR)/bin/pip uninstall -y "orquesta" || echo "not installed"; \
536+
$(VIRTUALENV_DIR)/bin/python -m pip uninstall -y "pytz" || echo "not installed"; \
537+
$(VIRTUALENV_DIR)/bin/python -m pip uninstall -y "python-dateutil" || echo "not installed"; \
538+
$(VIRTUALENV_DIR)/bin/python -m pip uninstall -y "orquesta" || echo "not installed"; \
539539
fi
540540

541541
# Install requirements
542542
for req in $(REQUIREMENTS); do \
543543
echo "Installing $$req..." ; \
544-
$(VIRTUALENV_DIR)/bin/pip install $(PIP_OPTIONS) -r $$req ; \
544+
$(VIRTUALENV_DIR)/bin/python -m pip install $(PIP_OPTIONS) -r $$req ; \
545545
done
546546

547547
# Install st2common package to load drivers defined in st2common setup.py
@@ -553,7 +553,7 @@ requirements: virtualenv .requirements .sdist-requirements install-runners insta
553553
# Note: We install prance here and not as part of any component
554554
# requirements.txt because it has a conflict with our dependency (requires
555555
# new version of requests) which we cant resolve at this moment
556-
$(VIRTUALENV_DIR)/bin/pip install "prance==0.15.0"
556+
$(VIRTUALENV_DIR)/bin/python -m pip install "prance==0.15.0"
557557

558558
# Install st2common to register metrics drivers
559559
# NOTE: We pass --no-deps to the script so we don't install all the

0 commit comments

Comments
 (0)