Use more generic TOX_CONSTRAINTS_FILE

UPPER_CONSTRAINTS_FILE is deprecated[1], we should start using the
new better shiny TOX_CONSTRAINTS_FILE instead.
Also this should fix broken tinyipa jobs after this[2] change merged.

[1] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
[2] https://review.opendev.org/760703

Change-Id: I99762e25133967c31679d2962607b2bf30459af5
changes/34/761334/2
Riccardo Pittau 2 years ago
parent adf9a76ecd
commit bceeea1b0a
  1. 2
      tinyipa/build-tinyipa.sh
  2. 20
      tinyipa/generate_tox_constraints.sh
  3. 2
      tox.ini

@ -119,7 +119,7 @@ if [ -n "$PYTHON_EXTRA_SOURCES_DIR_LIST" ]; then
done
fi
$WORKDIR/generate_upper_constraints.sh upper-constraints.txt
$WORKDIR/generate_tox_constraints.sh upper-constraints.txt
if [ -n "$IRONIC_LIB_SOURCE" ]; then
sed -i '/ironic-lib/d' upper-constraints.txt $BUILDDIR/tmp/ipa-requirements.txt
fi

@ -45,16 +45,16 @@ fail() {
exit 1
}
upper_constraints_is_not_null() {
test "${UPPER_CONSTRAINTS_FILE:-""}" != ""
tox_constraints_is_not_null() {
test "${TOX_CONSTRAINTS_FILE:-""}" != ""
}
copy_uc() {
copy "${UPPER_CONSTRAINTS_FILE:-""}" "${DESTINATION}"
copy "${TOX_CONSTRAINTS_FILE:-""}" "${DESTINATION}"
}
download_uc() {
download "${UPPER_CONSTRAINTS_FILE:-""}" "${DESTINATION}"
download "${TOX_CONSTRAINTS_FILE:-""}" "${DESTINATION}"
}
copy_new_requirements_uc() {
@ -72,23 +72,23 @@ copy_new_requirements_uc() {
download_from_tox_ini_url() {
local url
# NOTE(mmitchell): This extracts the URL defined as the default value for
# UPPER_CONSTRAINTS_FILE in tox.ini. This is used by image
# TOX_CONSTRAINTS_FILE in tox.ini. This is used by image
# builders to avoid duplicating the default value in multiple
# scripts. This is specially done to leverage the release
# tools that automatically update the tox.ini when projects
# are released.
url=$(sed -n 's/^.*{env:UPPER_CONSTRAINTS_FILE\:\([^}]*\)}.*$/\1/p' $TOX_INI | head -n1)
url=$(sed -n 's/^.*{env:TOX_CONSTRAINTS_FILE\:\([^}]*\)}.*$/\1/p' $TOX_INI | head -n1)
log "tox.ini indicates '${url}' as fallback."
download "${url}" "${DESTINATION}"
}
log "Generating local constraints file..."
if upper_constraints_is_not_null; then
log "UPPER_CONSTRAINTS_FILE is defined as '${UPPER_CONSTRAINTS_FILE:-""}'"
copy_uc || download_uc || fail "Failed to copy or download file indicated in UPPER_CONSTRAINTS_FILE."
if tox_constraints_is_not_null; then
log "TOX_CONSTRAINTS_FILE is defined as '${TOX_CONSTRAINTS_FILE:-""}'"
copy_uc || download_uc || fail "Failed to copy or download file indicated in TOX_CONSTRAINTS_FILE."
else
log "UPPER_CONSTRAINTS_FILE is not defined. Using fallback strategies."
log "TOX_CONSTRAINTS_FILE is not defined. Using fallback strategies."
copy_new_requirements_uc || \
download_from_tox_ini_url || \

@ -11,7 +11,7 @@ setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
[testenv:pep8]

Loading…
Cancel
Save