Use "pip -m install"

Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value - after
adding constraints to deps as is best practice as well.

Mosts tests itself use "pip install" in the shell scripts which sets
also the constraints. Change that to "python -m pip install" like done
for tox.

Change-Id: I27f80d8aa4ac3688ee56e8a9234e34f4e09afe34
This commit is contained in:
Andreas Jaeger 2020-04-26 14:42:30 +02:00
parent ec787687e6
commit 74797e4291
3 changed files with 6 additions and 6 deletions

View File

@ -96,7 +96,7 @@ if [[ "${ID,,}" == "fedora" ]]; then
sudo dnf -y install redhat-lsb-core yum-utils
# openSUSE 42.1 does not have python-ndg-httpsclient
elif [[ "${ID,,}" == *suse* ]] && [[ ${VERSION} == "42.1" ]]; then
sudo pip install ndg-httpsclient
sudo python -m pip install ndg-httpsclient
fi
# Get a list of packages to install with bindep. If packages need to be

View File

@ -197,7 +197,7 @@ else
fi
# Install all python packages
pip install ${PIP_OPTS}
python -m pip install ${PIP_OPTS}
# Download the Ansible role repositories if they are not present on the host.
# This is ignored if there is no ansible-role-requirements file.

View File

@ -6,8 +6,6 @@ envlist = docs,linters,func
[testenv]
basepython = python3
usedevelop = True
install_command =
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} {opts} {packages}
commands =
/usr/bin/find . -type f -name "*.pyc" -delete
passenv =
@ -27,7 +25,9 @@ setenv =
WORKING_DIR={toxinidir}
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
bash -c "rm -rf doc/build"
doc8 doc
@ -45,7 +45,7 @@ commands =
extensions = .rst
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html