From 1774de95b7d55616b25f09b199f48f98fb6c2c32 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Wed, 22 Sep 2021 09:52:48 +0200 Subject: [PATCH] Remove the openstack-upgrade action The openstack-principle reactive layer brings both the openstack-origin option and the openstack-upgrade action, none of which being needed for this charm. This layer has been used already since the very first commit of this charm, most likely for no specific reason. Also synced tox/pip boilerplate in order to include: * https://github.com/openstack-charmers/release-tools/pull/156 * https://github.com/openstack-charmers/release-tools/pull/157 Closes-Bug: #1944953 Change-Id: I001f435c648229b65fb718a78a33e6303a0faf11 --- .zuul.yaml | 3 +-- pip.sh | 18 ++++++++++++++++++ src/layer.yaml | 3 +-- src/tox.ini | 4 ++-- tox.ini | 17 ++++++++++++++++- 5 files changed, 38 insertions(+), 7 deletions(-) create mode 100755 pip.sh diff --git a/.zuul.yaml b/.zuul.yaml index b3037e9..fd20909 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,5 +1,4 @@ - project: templates: - - python35-charm-jobs - - openstack-python3-ussuri-jobs + - openstack-python3-charm-jobs - openstack-cover-jobs diff --git a/pip.sh b/pip.sh new file mode 100755 index 0000000..9a7e6b0 --- /dev/null +++ b/pip.sh @@ -0,0 +1,18 @@ +#!/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 "$@" diff --git a/src/layer.yaml b/src/layer.yaml index fec8d11..651de9c 100644 --- a/src/layer.yaml +++ b/src/layer.yaml @@ -2,7 +2,7 @@ includes: - layer:coordinator - layer:leadership - layer:snap - - layer:openstack-principle + - layer:openstack - interface:mysql-shared - interface:mysql-router - interface:mysql-innodb-cluster @@ -20,7 +20,6 @@ repo: https://opendev.org/openstack/charm-mysql-innodb-cluster config: deletes: - verbose - - openstack-origin - use-internal-endpoints - debug - use-syslog diff --git a/src/tox.ini b/src/tox.ini index e763047..b40d295 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -22,12 +22,12 @@ skip_missing_interpreters = False requires = pip < 20.3 virtualenv < 20.0 # NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci -minversion = 3.2.0 +minversion = 3.18.0 [testenv] setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 -whitelist_externals = juju +allowlist_externals = juju passenv = HOME TERM CS_* OS_* TEST_* deps = -r{toxinidir}/test-requirements.txt install_command = diff --git a/tox.ini b/tox.ini index 5c81801..22159df 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,21 @@ 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 [testenv] setenv = VIRTUAL_ENV={envdir} @@ -21,7 +36,7 @@ setenv = VIRTUAL_ENV={envdir} JUJU_REPOSITORY={toxinidir}/build passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY install_command = - pip install {opts} {packages} + {toxinidir}/pip.sh install {opts} {packages} deps = -r{toxinidir}/requirements.txt