Skip to content

Commit 5948af7

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'. Conflicts: tox.ini NOTE(elod.illes): conflict is due to branch specific upper constraints link. Also, lower-constraints is not yet removed from this branch so to avoid silently using wrong upper constraints instead of lower ones, the install_command needs to be redefined in lower-constraints target. Change-Id: Iae07e1c5abde09874928951ac55c2d0355bcd244 (cherry picked from commit 36aedba) (cherry picked from commit 49d2547) (cherry picked from commit e1a66af)
1 parent b1d635c commit 5948af7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tox.ini

Lines changed: 3 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:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
29-
-r{toxinidir}/test-requirements.txt
27+
install_command = python -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby} {opts} {packages}
28+
deps = -r{toxinidir}/test-requirements.txt
3029
-r{toxinidir}/requirements.txt
3130
commands =
3231
find . -type f -name "*.pyc" -delete
@@ -91,7 +90,6 @@ commands =
9190
# This environment is called from CI scripts to test and publish
9291
# the API Ref to docs.openstack.org.
9392
deps =
94-
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
9593
-r{toxinidir}/doc/requirements.txt
9694
commands =
9795
rm -rf api-ref/build
@@ -143,7 +141,6 @@ paths = ./glance/hacking
143141

144142
[testenv:docs]
145143
deps =
146-
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
147144
-r{toxinidir}/doc/requirements.txt
148145
commands =
149146
rm -fr doc/build
@@ -158,7 +155,6 @@ commands = {posargs}
158155

159156
[testenv:releasenotes]
160157
deps =
161-
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
162158
-r{toxinidir}/doc/requirements.txt
163159
commands =
164160
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@@ -190,6 +186,7 @@ commands =
190186
oslo_debug_helper {posargs}
191187

192188
[testenv:lower-constraints]
189+
install_command = python -m pip install {opts} {packages}
193190
deps =
194191
-c{toxinidir}/lower-constraints.txt
195192
-r{toxinidir}/test-requirements.txt

0 commit comments

Comments
 (0)