Stop configuring install_command in tox and stop use pip.

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. Use the
right way when it's necessary.

Change-Id: I410173d5fdcd8c592d98eed2f48b98e06299e8b3
This commit is contained in:
Daniel Bengtsson 2019-11-15 10:06:35 +01:00
parent 045f133f16
commit bf2beb9e86
3 changed files with 17 additions and 18 deletions

View File

@ -38,7 +38,7 @@ jmespath==0.9.0
jsonpatch==1.16
jsonpointer==1.13
jsonschema==2.6.0
keystoneauth1==3.6.2
keystoneauth1==3.14.0
kombu==4.0.0
linecache2==1.0.0
MarkupSafe==1.0

View File

@ -6,7 +6,7 @@ six>=1.10.0 # MIT
Babel!=2.4.0,>=2.3.4 # BSD
cliff!=2.9.0,>=2.8.0 # Apache-2.0
keystoneauth1>=3.6.2 # Apache-2.0
keystoneauth1>=3.14.0 # Apache-2.0
openstacksdk>=0.17.0 # Apache-2.0
osc-lib>=2.0.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0

31
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
minversion = 3.1
minversion = 3.2.0
envlist = py37,pep8
skipdist = True
# Automatic envs (pyXX) will only use the python version appropriate to that
@ -10,9 +10,7 @@ ignore_basepython_conflict = True
[testenv]
usedevelop = True
basepython = python3
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
setenv = OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps =
@ -24,6 +22,7 @@ whitelist_externals = stestr
[testenv:fast8]
# Use same environment directory as pep8 env to save space and install time
setenv = VIRTUAL_ENV={envdir}
envdir = {toxworkdir}/pep8
commands =
{toxinidir}/tools/fast8.sh
@ -62,12 +61,12 @@ commands =
[testenv:unit-tips]
commands =
pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
pip install -q -e "git+file://{toxinidir}/../openstacksdk#egg=openstacksdk"
pip freeze
python -m pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
python -m pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
python -m pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
python -m pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
pythom -m pip install -q -e "git+file://{toxinidir}/../openstacksdk#egg=openstacksdk"
python -m pip freeze
stestr run {posargs}
whitelist_externals = stestr
@ -81,12 +80,12 @@ commands =
setenv = OS_TEST_PATH=./openstackclient/tests/functional
passenv = OS_*
commands =
pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
pip install -q -U -e "git+file://{toxinidir}/../openstacksdk#egg=openstacksdk"
pip freeze
python -m pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
python -m pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
python -m pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
python -m pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
python -m pip install -q -U -e "git+file://{toxinidir}/../openstacksdk#egg=openstacksdk"
python -m pip freeze
stestr run {posargs}
[testenv:venv]