Fix up the tox.ini to work with tox 4

* unpin the requires for pip, virtualenv and setuptools
* remove the pip.sh installer file.
* split the passenv to to have a var on each line (overcomes new ','
  requirement).
* switch charm-tools to 2.8.4 to remove ruamel requirement that doesn't
  work on Python 3.10
* Update jammy-yoga.yaml bundle to remove unused machine 8 (now a hard
  error on juju)

Change-Id: I44849aac8ead5e3e660ccd9d1305cc991461d02d
(cherry picked from commit 09ade6b5ee)
This commit is contained in:
Alex Kavanagh 2023-01-04 11:32:34 +00:00
parent 881edb5d14
commit ad399df18f
3 changed files with 8 additions and 37 deletions

18
pip.sh
View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
#
# This file is managed centrally by release-tools and should not be modified
# within individual charm repos. See the 'global' dir contents for available
# choices of tox.ini for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools
#
# setuptools 58.0 dropped the support for use_2to3=true which is needed to
# install blessings (an indirect dependency of charm-tools).
#
# More details on the beahvior of tox and virtualenv creation can be found at
# https://github.com/tox-dev/tox/issues/448
#
# This script is wrapper to force the use of the pinned versions early in the
# process when the virtualenv was created and upgraded before installing the
# depedencies declared in the target.
pip install 'pip<20.3' 'setuptools<50.0.0'
pip "$@"

View File

@ -17,8 +17,6 @@ machines:
'5':
'6':
'7':
'8':
series: bionic # nagios not supported on focal+ yet
applications:

25
tox.ini
View File

@ -14,18 +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
@ -34,13 +22,16 @@ minversion = 3.18.0
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
CHARM_DIR={envdir}
install_command =
{toxinidir}/pip.sh install {opts} {packages}
commands = stestr run --slowest {posargs}
allowlist_externals =
charmcraft
rename.sh
passenv = HOME TERM CS_* OS_* TEST_*
{toxinidir}/rename.sh
passenv =
HOME
TERM
CS_*
OS_*
TEST_*
deps = -r{toxinidir}/test-requirements.txt
[testenv:build]
@ -84,7 +75,7 @@ deps = -r{toxinidir}/requirements.txt
[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
charm-tools==2.8.3
charm-tools==2.8.4
commands = flake8 {posargs} hooks unit_tests tests actions lib files
charm-proof