From bceeea1b0a85d1b680e02c6bf4a07b6fb9a5372a Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Wed, 4 Nov 2020 10:37:11 +0100 Subject: [PATCH] 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 --- tinyipa/build-tinyipa.sh | 2 +- ...traints.sh => generate_tox_constraints.sh} | 20 +++++++++---------- tox.ini | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename tinyipa/{generate_upper_constraints.sh => generate_tox_constraints.sh} (76%) diff --git a/tinyipa/build-tinyipa.sh b/tinyipa/build-tinyipa.sh index bb7694b..acd4fe0 100755 --- a/tinyipa/build-tinyipa.sh +++ b/tinyipa/build-tinyipa.sh @@ -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 diff --git a/tinyipa/generate_upper_constraints.sh b/tinyipa/generate_tox_constraints.sh similarity index 76% rename from tinyipa/generate_upper_constraints.sh rename to tinyipa/generate_tox_constraints.sh index 2b0ce87..a109f99 100755 --- a/tinyipa/generate_upper_constraints.sh +++ b/tinyipa/generate_tox_constraints.sh @@ -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 || \ diff --git a/tox.ini b/tox.ini index 365238b..46f67cd 100644 --- a/tox.ini +++ b/tox.ini @@ -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]