Minimal update to tox.ini for tests to pass

- remove pip.sh
- unpin top level requirements
- update charm-tools version for pep8 test
- update osci.yaml tox_extra_args for compatibility

Signed-off-by: Rafael Lopez <rafael.lopez@canonical.com>
Change-Id: Iec9fbd296d6d5b5fa647739d5588218c28e0a773
This commit is contained in:
Rafael Lopez 2023-01-16 04:22:20 +00:00
parent 9905ca13ee
commit 43b98b6416
3 changed files with 8 additions and 30 deletions

View File

@ -16,4 +16,4 @@
- osci-lint
- tox-py36
vars:
tox_extra_args: bionic_model:bionic-ha
tox_extra_args: '-- bionic_model:bionic-ha'

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 "$@"

18
tox.ini
View File

@ -22,25 +22,21 @@ skip_missing_interpreters = False
# * 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
[testenv]
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_*
passenv =
HOME
TERM
CS_*
OS_*
TEST_*
deps = -r{toxinidir}/test-requirements.txt
[testenv:build]
@ -77,7 +73,7 @@ commands = stestr run --slowest {posargs}
[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
charm-tools==2.8.3
charm-tools
commands = flake8 {posargs} hooks unit_tests tests actions lib files
charm-proof