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:
parent
ec787687e6
commit
74797e4291
@ -96,7 +96,7 @@ if [[ "${ID,,}" == "fedora" ]]; then
|
|||||||
sudo dnf -y install redhat-lsb-core yum-utils
|
sudo dnf -y install redhat-lsb-core yum-utils
|
||||||
# openSUSE 42.1 does not have python-ndg-httpsclient
|
# openSUSE 42.1 does not have python-ndg-httpsclient
|
||||||
elif [[ "${ID,,}" == *suse* ]] && [[ ${VERSION} == "42.1" ]]; then
|
elif [[ "${ID,,}" == *suse* ]] && [[ ${VERSION} == "42.1" ]]; then
|
||||||
sudo pip install ndg-httpsclient
|
sudo python -m pip install ndg-httpsclient
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get a list of packages to install with bindep. If packages need to be
|
# Get a list of packages to install with bindep. If packages need to be
|
||||||
|
@ -197,7 +197,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Install all python packages
|
# 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.
|
# Download the Ansible role repositories if they are not present on the host.
|
||||||
# This is ignored if there is no ansible-role-requirements file.
|
# This is ignored if there is no ansible-role-requirements file.
|
||||||
|
8
tox.ini
8
tox.ini
@ -6,8 +6,6 @@ envlist = docs,linters,func
|
|||||||
[testenv]
|
[testenv]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command =
|
|
||||||
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} {opts} {packages}
|
|
||||||
commands =
|
commands =
|
||||||
/usr/bin/find . -type f -name "*.pyc" -delete
|
/usr/bin/find . -type f -name "*.pyc" -delete
|
||||||
passenv =
|
passenv =
|
||||||
@ -27,7 +25,9 @@ setenv =
|
|||||||
WORKING_DIR={toxinidir}
|
WORKING_DIR={toxinidir}
|
||||||
|
|
||||||
[testenv:docs]
|
[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 =
|
commands =
|
||||||
bash -c "rm -rf doc/build"
|
bash -c "rm -rf doc/build"
|
||||||
doc8 doc
|
doc8 doc
|
||||||
@ -45,7 +45,7 @@ commands =
|
|||||||
extensions = .rst
|
extensions = .rst
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
deps = -r{toxinidir}/doc/requirements.txt
|
deps = {[testenv:docs]deps}
|
||||||
commands =
|
commands =
|
||||||
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user