Fix pip install for py3 in travis on st2client check
@@ -229,9 +229,6 @@ check-python-packages:
@echo "================== CHECK PYTHON PACKAGES ===================="
@echo ""
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || $(PYTHON_VERSION) -m venv $(VIRTUALENV_COMPONENTS_DIR) || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_COMPONENTS_DIR) --no-download
- @if [[ $(PYTHON_VERSION) == *"python3.6"* ]]; then \
- $(PYTHON_VERSION) -m pip install --upgrade pip; \
- fi
@for component in $(COMPONENTS_WITHOUT_ST2TESTS); do \
echo "==========================================================="; \
echo "Checking component:" $$component; \
@@ -380,9 +377,6 @@ flake8: requirements .flake8
@echo "==================== st2client install check ===================="
@echo
test -f $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate || $(PYTHON_VERSION) -m venv $(VIRTUALENV_ST2CLIENT_DIR) || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_ST2CLIENT_DIR) --no-download
- @if [[ $(PYTHON_VERSION) == *"python3.6"* ]]; then \
- $(PYTHON_VERSION) -m pip install --upgrade pip; \
- fi
# Setup PYTHONPATH in bash activate script...
# Delete existing entries (if any)
@@ -396,11 +390,19 @@ flake8: requirements .flake8
touch $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate
chmod +x $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate
- $(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
+ if [[ $(PYTHON_VERSION) == *"python2.7"* ]]; then \
+ echo 'Upgrading pip==$(PIP_VERSION) in python2.7 virtualenv' \
+ $(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"; \
+ else \
+ echo 'Upgrading pip==$(PIP_VERSION) in python3.x virtualenv' \
+ $(VIRTUALENV_ST2CLIENT_DIR)/bin/python -m pip install --user --upgrade "pip==$(PIP_VERSION)"; \
+ fi
+
# NOTE We need to upgrade setuptools to avoid bug with dependency resolving in old versions
# Setuptools 42 added support for python_requires, which is used by the configparser package,
# which is required by the importlib-metadata package
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "setuptools==44.1.0"
+
$(VIRTUALENV_ST2CLIENT_DIR)/bin/activate; cd st2client ; ../$(VIRTUALENV_ST2CLIENT_DIR)/bin/python setup.py install ; cd ..
$(VIRTUALENV_ST2CLIENT_DIR)/bin/st2 --version
$(VIRTUALENV_ST2CLIENT_DIR)/bin/python -c "import st2client"
