Skip to content

Commit 36aedba

Browse files
author
Elod Illes
committed
[CI] Add upper constraints to install command
In cases when a package is installed in tox's develop-inst phase upper constraints are not used if it were not defined in 'deps' of the tox target. This caused for example 'tox -e docs' to fail in case a package introduced some branch incompatible change. There are two option to fix this: * add the upper constraints to 'deps' of the target (and pre-install requirements for some cases) OR * use it in the install_command In the past the latter needed some extra attention (due to e.g. lower constraints tests) and projects were encouraged to remove the install_command, but nowadays this seems better fitting for some project and easier to use. So this patch fixes the upper constraints usage via the custom install_command and by removing it from 'deps'. Change-Id: Iae07e1c5abde09874928951ac55c2d0355bcd244
1 parent 14bd3eb commit 36aedba

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tox.ini

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ setenv =
2424
# clue for oslo.db to use file-based database.
2525
OS_TEST_DBAPI_ADMIN_CONNECTION=sqlite:////tmp/placeholder-never-created-nor-used.db
2626
usedevelop = True
27-
install_command = pip install {opts} {packages}
28-
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
29-
-r{toxinidir}/test-requirements.txt
27+
install_command = python -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
28+
deps = -r{toxinidir}/test-requirements.txt
3029
-r{toxinidir}/requirements.txt
3130
commands =
3231
find . -type f -name "*.pyc" -delete
@@ -103,7 +102,6 @@ commands =
103102
# This environment is called from CI scripts to test and publish
104103
# the API Ref to docs.openstack.org.
105104
deps =
106-
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
107105
-r{toxinidir}/doc/requirements.txt
108106
commands =
109107
rm -rf api-ref/build
@@ -151,7 +149,6 @@ paths = ./glance/hacking
151149

152150
[testenv:docs]
153151
deps =
154-
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
155152
-r{toxinidir}/doc/requirements.txt
156153
commands =
157154
rm -fr doc/build
@@ -166,7 +163,6 @@ commands = {posargs}
166163

167164
[testenv:releasenotes]
168165
deps =
169-
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
170166
-r{toxinidir}/doc/requirements.txt
171167
commands =
172168
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

0 commit comments

Comments
 (0)