From ea4abbab80210dd2990d879e6a48b67091004ecb Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Wed, 14 Dec 2022 08:37:17 -0500 Subject: [PATCH 1/2] Remove interface/layer env vars from source tox.ini These env vars were removed from tox.ini in the source charms last cycle as part of moving them to the charmcraft.yaml. The charmcraft.yaml here in release-tools is already up-to-date. --- global/source-zaza/tox.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/global/source-zaza/tox.ini b/global/source-zaza/tox.ini index 713990e..506419c 100644 --- a/global/source-zaza/tox.ini +++ b/global/source-zaza/tox.ini @@ -31,10 +31,8 @@ minversion = 3.18.0 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux - LAYER_PATH={toxinidir}/layers - INTERFACE_PATH={toxinidir}/interfaces JUJU_REPOSITORY={toxinidir}/build -passenv = no_proxy http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY +passenv = no_proxy http_proxy https_proxy JUJU_REPOSITORY install_command = {toxinidir}/pip.sh install {opts} {packages} allowlist_externals = From 167dc1c68be47f4b26d9fbde8f3e4741853dad02 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Wed, 14 Dec 2022 08:28:30 -0500 Subject: [PATCH 2/2] Add tox 4.x support to global tox.ini files * Unpin requires in tox.ini * Add pip.sh to allowlist_externals * Move tox passenv variables to separate lines. tox no longer supports space-separation for a single line with multiple variables. They need to either be space-separated or on separate lines. * Use -- to separate func-target commands from tox ones These changes were tested in the following reviews: * https://review.opendev.org/c/openstack/charm-keystone/+/867527 * https://review.opendev.org/c/openstack/charm-aodh/+/867528 --- global/classic-zaza/tox.ini | 21 +++++++-------------- global/source-zaza/src/tox.ini | 17 ++++++----------- global/source-zaza/tox.ini | 22 +++++++--------------- 3 files changed, 20 insertions(+), 40 deletions(-) diff --git a/global/classic-zaza/tox.ini b/global/classic-zaza/tox.ini index 2d6468c..94f0688 100644 --- a/global/classic-zaza/tox.ini +++ b/global/classic-zaza/tox.ini @@ -14,19 +14,6 @@ skipsdist = True sitepackages = False # NOTE: Avoid false positives by not skipping missing interpreters. skip_missing_interpreters = False -# NOTES: -# * We avoid the new dependency resolver by pinning pip < 20.3, see -# https://github.com/pypa/pip/issues/9187 -# * Pinning dependencies requires tox >= 3.2.0, see -# https://tox.readthedocs.io/en/latest/config.html#conf-requires -# * It is also necessary to pin virtualenv as a newer virtualenv would still -# lead to fetching the latest pip in the func* tox targets, see -# https://stackoverflow.com/a/38133283 -requires = - pip < 20.3 - virtualenv < 20.0 - setuptools < 50.0.0 - # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci minversion = 3.18.0 @@ -39,8 +26,14 @@ install_command = commands = stestr run --slowest {posargs} allowlist_externals = charmcraft + {toxinidir}/pip.sh rename.sh -passenv = HOME TERM CS_* OS_* TEST_* +passenv = + HOME + TERM + CS_* + OS_* + TEST_* deps = -r{toxinidir}/test-requirements.txt [testenv:build] diff --git a/global/source-zaza/src/tox.ini b/global/source-zaza/src/tox.ini index b40d295..ba88759 100644 --- a/global/source-zaza/src/tox.ini +++ b/global/source-zaza/src/tox.ini @@ -11,16 +11,6 @@ skipsdist = True sitepackages = False # NOTE: Avoid false positives by not skipping missing interpreters. skip_missing_interpreters = False -# NOTES: -# * We avoid the new dependency resolver by pinning pip < 20.3, see -# https://github.com/pypa/pip/issues/9187 -# * Pinning dependencies requires tox >= 3.2.0, see -# https://tox.readthedocs.io/en/latest/config.html#conf-requires -# * It is also necessary to pin virtualenv as a newer virtualenv would still -# lead to fetching the latest pip in the func* tox targets, see -# https://stackoverflow.com/a/38133283 -requires = pip < 20.3 - virtualenv < 20.0 # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci minversion = 3.18.0 @@ -28,7 +18,12 @@ minversion = 3.18.0 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 allowlist_externals = juju -passenv = HOME TERM CS_* OS_* TEST_* +passenv = + HOME + TERM + CS_* + OS_* + TEST_* deps = -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} diff --git a/global/source-zaza/tox.ini b/global/source-zaza/tox.ini index 506419c..92ce03d 100644 --- a/global/source-zaza/tox.ini +++ b/global/source-zaza/tox.ini @@ -11,19 +11,6 @@ envlist = pep8,py3 sitepackages = False # NOTE: Avoid false positives by not skipping missing interpreters. skip_missing_interpreters = False -# NOTES: -# * We avoid the new dependency resolver by pinning pip < 20.3, see -# https://github.com/pypa/pip/issues/9187 -# * Pinning dependencies requires tox >= 3.2.0, see -# https://tox.readthedocs.io/en/latest/config.html#conf-requires -# * It is also necessary to pin virtualenv as a newer virtualenv would still -# lead to fetching the latest pip in the func* tox targets, see -# https://stackoverflow.com/a/38133283 -requires = - pip < 20.3 - virtualenv < 20.0 - setuptools<50.0.0 - # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci minversion = 3.18.0 @@ -32,13 +19,18 @@ setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux JUJU_REPOSITORY={toxinidir}/build -passenv = no_proxy http_proxy https_proxy JUJU_REPOSITORY +passenv = + no_proxy + http_proxy + https_proxy + JUJU_REPOSITORY install_command = {toxinidir}/pip.sh install {opts} {packages} allowlist_externals = charmcraft bash tox + {toxinidir}/pip.sh rename.sh deps = -r{toxinidir}/requirements.txt @@ -92,7 +84,7 @@ changedir = {toxinidir}/src commands = bash -c "if [ ! -f ../*.charm ]; then echo 'Charm does not exist. Run tox -e build'; exit 1; fi" tox --version - tox -e func-target {posargs} + tox -e func-target -- {posargs} [testenv:cover] # Technique based heavily upon