Add charmcraft 3 support

Update the charmcraft.yaml file to use base and platforms, only
allowing noble support. Remove test bundles for older bases.

Also modernize build process using the reactive plugin, and modernize
tox.ini, update build.lock pins and remove cruft.

Change-Id: Ib3ef3791ba7d6d06a1016be85625a575e4eb6ae1
This commit is contained in:
Peter Sabaini 2024-06-30 12:50:53 +02:00
parent fca51985e0
commit ec41cb0e41
16 changed files with 201 additions and 475 deletions

View File

@ -1,7 +0,0 @@
# NOTES(lourot):
# * We don't install charmcraft via pip anymore because it anyway spins up a
# container and scp the system's charmcraft snap inside it. So the charmcraft
# snap is necessary on the system anyway.
# * `tox -e build` successfully validated with charmcraft 1.2.1
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.

View File

@ -2,34 +2,33 @@ type: charm
parts: parts:
charm: charm:
charm-entrypoint: "hooks/install" plugin: reactive
reactive-charm-build-arguments:
- --binary-wheels-from-source
build-packages: build-packages:
- tox - tox
- git - git
- python3-dev - python3-dev
- libffi-dev - libffi-dev
override-build: | source: src/
apt-get install ca-certificates -y build-snaps:
tox -e build-reactive - charm/latest/edge
override-stage: | build-environment:
echo "Copying charm to staging area: $CRAFT_STAGE" - CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/
NAME=$(ls $CRAFT_PART_BUILD/build/builds) - CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/
cp -r $CRAFT_PART_BUILD/build/builds/$NAME/* $CRAFT_STAGE/
override-prime: |
# For some reason, the normal priming chokes on the fact that there's a
# hooks directory.
cp -r $CRAFT_STAGE/* .
bases: base: ubuntu@24.04
- build-on: build-base: ubuntu@24.04
- name: ubuntu platforms:
channel: "20.04" amd64:
architectures: build-on: amd64
- amd64 build-for: amd64
run-on: arm64:
- name: ubuntu build-on: arm64
channel: "20.04" build-for: arm64
architectures: [amd64, s390x, ppc64el, arm64] s390x:
- name: ubuntu build-on: s390x
channel: "22.04" build-for: s390x
architectures: [amd64, s390x, ppc64el, arm64] ppc64el:
build-on: ppc64el
build-for: ppc64el

View File

@ -2,10 +2,9 @@
templates: templates:
- charm-unit-jobs-py38 - charm-unit-jobs-py38
- charm-unit-jobs-py39 - charm-unit-jobs-py39
- charm-yoga-functional-jobs
- charm-functional-jobs - charm-functional-jobs
vars: vars:
needs_charm_build: true needs_charm_build: true
charm_build_name: ceph-fs charm_build_name: ceph-fs
build_type: charmcraft build_type: charmcraft
charmcraft_channel: 2.x/stable charmcraft_channel: 3.x/beta

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

@ -1,13 +1,3 @@
# 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 *requirements.txt files for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools
#
# NOTE(lourot): This might look like a duplication of test-requirements.txt but
# some tox targets use only test-requirements.txt whereas charm-build uses only
# requirements.txt
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
# NOTE: newer versions of cryptography require a Rust compiler to build, # NOTE: newer versions of cryptography require a Rust compiler to build,
# see # see
# * https://github.com/openstack-charmers/zaza/issues/421 # * https://github.com/openstack-charmers/zaza/issues/421

View File

@ -13,8 +13,8 @@
"item": "layer:basic", "item": "layer:basic",
"url": "https://github.com/juju-solutions/layer-basic.git", "url": "https://github.com/juju-solutions/layer-basic.git",
"vcs": null, "vcs": null,
"branch": "1edd5ccd3fb6240ca734b64a7dae9f1cb30b66f6", "branch": "33526bd6aaa01ffe717a5c66ed62bc4790344ef2",
"commit": "1edd5ccd3fb6240ca734b64a7dae9f1cb30b66f6" "commit": "33526bd6aaa01ffe717a5c66ed62bc4790344ef2"
}, },
{ {
"type": "layer", "type": "layer",
@ -26,27 +26,19 @@
}, },
{ {
"type": "layer", "type": "layer",
"item": "layer:openstack-principle", "item": "layer:ceph",
"url": "https://github.com/openstack/charm-layer-openstack-principle", "url": "https://github.com/openstack/charm-layer-ceph.git",
"vcs": null, "vcs": null,
"branch": "2541283a7f9c3fa923c0fccd7257e217e11dadcd", "branch": "17d40abd8d9ec3b8c32756ca981c80c4733c016f",
"commit": "2541283a7f9c3fa923c0fccd7257e217e11dadcd" "commit": "17d40abd8d9ec3b8c32756ca981c80c4733c016f"
}, },
{ {
"type": "layer", "type": "layer",
"item": "layer:openstack-api", "item": "ceph-fs",
"url": "https://github.com/openstack/charm-layer-openstack-api",
"vcs": null,
"branch": "34311a62e963d0ce903b7ddb9d70b8f071f71651",
"commit": "34311a62e963d0ce903b7ddb9d70b8f071f71651"
},
{
"type": "layer",
"item": "aodh",
"url": null, "url": null,
"vcs": null, "vcs": null,
"branch": null, "branch": "e6c6f13cde785174cee1a48a8df1c581e394fc3b",
"commit": "" "commit": "e6c6f13cde785174cee1a48a8df1c581e394fc3b"
}, },
{ {
"type": "layer", "type": "layer",
@ -58,65 +50,25 @@
}, },
{ {
"type": "layer", "type": "layer",
"item": "interface:mysql-shared", "item": "interface:ceph-mds",
"url": "https://github.com/openstack/charm-interface-mysql-shared", "url": "https://opendev.org/openstack/charm-interface-ceph-client.git",
"vcs": null, "vcs": null,
"branch": "f90f8c6edce21e4da3a872f0f9d6761730ce025d", "branch": "d9f3b53ca0cf30e47347a68beab59da5c03ce4c7",
"commit": "f90f8c6edce21e4da3a872f0f9d6761730ce025d" "commit": "d9f3b53ca0cf30e47347a68beab59da5c03ce4c7"
}, },
{ {
"type": "layer", "type": "layer",
"item": "interface:rabbitmq", "item": "interface:cephfs_share",
"url": "https://github.com/openstack/charm-interface-rabbitmq", "url": null,
"vcs": null, "vcs": null,
"branch": "383121fc584d2d3bf9d233eba0d3708398a4c468", "branch": "e6c6f13cde785174cee1a48a8df1c581e394fc3b",
"commit": "383121fc584d2d3bf9d233eba0d3708398a4c468" "commit": "e6c6f13cde785174cee1a48a8df1c581e394fc3b"
},
{
"type": "layer",
"item": "interface:keystone",
"url": "https://github.com/openstack/charm-interface-keystone",
"vcs": null,
"branch": "36ea7b385a569ebabca7184ed4ce8420bb8fa61a",
"commit": "36ea7b385a569ebabca7184ed4ce8420bb8fa61a"
},
{
"type": "layer",
"item": "interface:hacluster",
"url": "https://github.com/openstack/charm-interface-hacluster.git",
"vcs": null,
"branch": "d91e83a1fa59a13f4160febfe536c68dc762e436",
"commit": "d91e83a1fa59a13f4160febfe536c68dc762e436"
},
{
"type": "layer",
"item": "interface:openstack-ha",
"url": "https://github.com/openstack/charm-interface-openstack-ha",
"vcs": null,
"branch": "a3b00e5b5fd857d130698c5cfe4b918877f0ab80",
"commit": "a3b00e5b5fd857d130698c5cfe4b918877f0ab80"
},
{
"type": "layer",
"item": "interface:mongodb",
"url": "https://github.com/cloud-green/juju-relation-mongodb",
"vcs": null,
"branch": "708b6ade852794b17447024a28e5ec2bb883538c",
"commit": "708b6ade852794b17447024a28e5ec2bb883538c"
},
{
"type": "layer",
"item": "interface:nrpe-external-master",
"url": "https://github.com/canonical/nrpe-external-master-interface",
"vcs": null,
"branch": "c58fe7b01a151d933681b5bf67e47ad3de65eeaa",
"commit": "c58fe7b01a151d933681b5bf67e47ad3de65eeaa"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "trove-classifiers", "package": "dnspython3",
"vcs": null, "vcs": null,
"version": "2024.4.10" "version": "1.12.0"
}, },
{ {
"type": "python_module", "type": "python_module",
@ -124,41 +76,17 @@
"vcs": null, "vcs": null,
"version": "0.11.0" "version": "0.11.0"
}, },
{
"type": "python_module",
"package": "dnspython",
"vcs": null,
"version": "2.6.1"
},
{
"type": "python_module",
"package": "netaddr",
"vcs": null,
"version": "0.7.19"
},
{ {
"type": "python_module", "type": "python_module",
"package": "packaging", "package": "packaging",
"vcs": null, "vcs": null,
"version": "24.0" "version": "24.1"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "pluggy", "package": "setuptools",
"vcs": null, "vcs": null,
"version": "1.5.0" "version": "71.1.0"
},
{
"type": "python_module",
"package": "anyio",
"vcs": null,
"version": "3.6.2"
},
{
"type": "python_module",
"package": "tomli",
"vcs": null,
"version": "2.0.1"
}, },
{ {
"type": "python_module", "type": "python_module",
@ -168,73 +96,29 @@
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "idna", "package": "flit_scm",
"vcs": null, "vcs": null,
"version": "3.7" "version": "1.7.0"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "calver", "package": "charms.reactive",
"vcs": null, "url": "git+https://github.com/canonical/charms.reactive.git",
"version": "2022.6.26" "branch": "0dc82abb7ac01f288042ee44b56a9d428c8fc46c",
}, "version": "0dc82abb7ac01f288042ee44b56a9d428c8fc46c",
{ "vcs": "git"
"type": "python_module",
"package": "wheel",
"vcs": null,
"version": "0.43.0"
},
{
"type": "python_module",
"package": "pip",
"vcs": null,
"version": "22.0.4"
},
{
"type": "python_module",
"package": "setuptools",
"vcs": null,
"version": "62.1.0"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "psutil", "package": "psutil",
"vcs": null, "vcs": null,
"version": "5.9.8" "version": "6.0.0"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "charms.openstack", "package": "pyxattr",
"url": "git+https://github.com/openstack/charms.openstack.git",
"branch": "stable/caracal",
"version": "018b72d734223db274b59f524b7887d8153cdb6d",
"vcs": "git"
},
{
"type": "python_module",
"package": "charmhelpers",
"url": "git+https://github.com/juju/charm-helpers.git",
"branch": "stable/caracal",
"version": "807f705d1d132bedb62b2eb743403e1d5867360f",
"vcs": "git"
},
{
"type": "python_module",
"package": "pathspec",
"vcs": null, "vcs": null,
"version": "0.12.1" "version": "0.8.1"
},
{
"type": "python_module",
"package": "hatchling",
"vcs": null,
"version": "1.24.2"
},
{
"type": "python_module",
"package": "Cython",
"vcs": null,
"version": "0.29.37"
}, },
{ {
"type": "python_module", "type": "python_module",
@ -242,6 +126,18 @@
"vcs": null, "vcs": null,
"version": "2.1.5" "version": "2.1.5"
}, },
{
"type": "python_module",
"package": "trove_classifiers",
"vcs": null,
"version": "2024.7.2"
},
{
"type": "python_module",
"package": "flit_core",
"vcs": null,
"version": "3.9.0"
},
{ {
"type": "python_module", "type": "python_module",
"package": "PyYAML", "package": "PyYAML",
@ -250,27 +146,53 @@
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "charms.reactive", "package": "charmhelpers",
"vcs": null, "url": "git+https://github.com/juju/charm-helpers.git",
"version": "1.5.2" "branch": "1b2d4dc8f8effd79d782241a32a0485af1f01e73",
"version": "1b2d4dc8f8effd79d782241a32a0485af1f01e73",
"vcs": "git"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "sniffio", "package": "pip",
"vcs": null, "vcs": null,
"version": "1.3.0" "version": "22.0.4"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "setuptools_scm", "package": "calver",
"vcs": null, "vcs": null,
"version": "6.4.2" "version": "2022.6.26"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "Jinja2", "package": "pluggy",
"vcs": null, "vcs": null,
"version": "3.1.3" "version": "1.5.0"
},
{
"type": "python_module",
"package": "pyudev",
"vcs": null,
"version": "0.24.3"
},
{
"type": "python_module",
"package": "six",
"vcs": null,
"version": "1.16.0"
},
{
"type": "python_module",
"package": "pathspec",
"vcs": null,
"version": "0.12.1"
},
{
"type": "python_module",
"package": "jinja2",
"vcs": null,
"version": "3.1.4"
}, },
{ {
"type": "python_module", "type": "python_module",
@ -280,15 +202,67 @@
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "flit_scm", "package": "charms.ceph",
"vcs": null, "url": "git+https://github.com/openstack/charms.ceph.git",
"version": "1.7.0" "branch": "64f3c1b12b14545a76321469478fb456b379832d",
"version": "64f3c1b12b14545a76321469478fb456b379832d",
"vcs": "git"
}, },
{ {
"type": "python_module", "type": "python_module",
"package": "flit_core", "package": "looseversion",
"vcs": null, "vcs": null,
"version": "3.9.0" "version": "1.3.0"
},
{
"type": "python_module",
"package": "hatchling",
"vcs": null,
"version": "1.25.0"
},
{
"type": "python_module",
"package": "netaddr",
"vcs": null,
"version": "0.7.19"
},
{
"type": "python_module",
"package": "Cython",
"vcs": null,
"version": "0.29.37"
},
{
"type": "python_module",
"package": "charms.openstack",
"url": "git+https://github.com/openstack/charms.openstack.git",
"branch": "355d65f64cc1dac133d885aa7cfc58b1804a0c30",
"version": "355d65f64cc1dac133d885aa7cfc58b1804a0c30",
"vcs": "git"
},
{
"type": "python_module",
"package": "wheel",
"vcs": null,
"version": "0.43.0"
},
{
"type": "python_module",
"package": "dnspython",
"vcs": null,
"version": "2.6.1"
},
{
"type": "python_module",
"package": "ceph_api",
"vcs": null,
"version": "0.4.0"
},
{
"type": "python_module",
"package": "setuptools_scm",
"vcs": null,
"version": "8.1.0"
} }
] ]
} }

View File

@ -11,8 +11,7 @@ tags:
- file-servers - file-servers
- misc - misc
series: series:
- focal - noble
- jammy
subordinate: false subordinate: false
requires: requires:
ceph-mds: ceph-mds:

View File

@ -1,44 +0,0 @@
variables:
openstack-origin: &openstack-origin cloud:focal-yoga
local_overlay_enabled: False
series: &series focal
applications:
ubuntu: # used to test mounts
charm: ch:ubuntu
num_units: 2
ceph-fs:
charm: ../../../ceph-fs.charm
num_units: 1
options:
source: *openstack-origin
pool-type: erasure-coded
ec-profile-k: 4
ec-profile-m: 2
ceph-osd:
charm: ch:ceph-osd
num_units: 6
storage:
osd-devices: 'cinder,10G'
options:
osd-devices: '/dev/test-non-existent'
source: *openstack-origin
channel: latest/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
monitor-count: '3'
source: *openstack-origin
channel: latest/edge
relations:
- - 'ceph-mon:mds'
- 'ceph-fs:ceph-mds'
- - 'ceph-osd:mon'
- 'ceph-mon:osd'

View File

@ -1,44 +0,0 @@
variables:
openstack-origin: &openstack-origin cloud:jammy-antelope
local_overlay_enabled: False
series: &series jammy
applications:
ubuntu: # used to test mounts
charm: ch:ubuntu
num_units: 2
ceph-fs:
charm: ../../../ceph-fs.charm
num_units: 1
options:
source: *openstack-origin
pool-type: erasure-coded
ec-profile-k: 4
ec-profile-m: 2
ceph-osd:
charm: ch:ceph-osd
num_units: 6
storage:
osd-devices: 'cinder,10G'
options:
osd-devices: '/dev/test-non-existent'
source: *openstack-origin
channel: reef/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
monitor-count: '3'
source: *openstack-origin
channel: reef/edge
relations:
- - 'ceph-mon:mds'
- 'ceph-fs:ceph-mds'
- - 'ceph-osd:mon'
- 'ceph-mon:osd'

View File

@ -1,44 +0,0 @@
variables:
openstack-origin: &openstack-origin cloud:jammy-bobcat
local_overlay_enabled: False
series: &series jammy
applications:
ubuntu: # used to test mounts
charm: ch:ubuntu
num_units: 2
ceph-fs:
charm: ../../../ceph-fs.charm
num_units: 1
options:
source: *openstack-origin
pool-type: erasure-coded
ec-profile-k: 4
ec-profile-m: 2
ceph-osd:
charm: ch:ceph-osd
num_units: 6
storage:
osd-devices: 'cinder,10G'
options:
osd-devices: '/dev/test-non-existent'
source: *openstack-origin
channel: latest/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
monitor-count: '3'
source: *openstack-origin
channel: latest/edge
relations:
- - 'ceph-mon:mds'
- 'ceph-fs:ceph-mds'
- - 'ceph-osd:mon'
- 'ceph-mon:osd'

View File

@ -1,44 +0,0 @@
variables:
openstack-origin: &openstack-origin cloud:jammy-caracal
local_overlay_enabled: False
series: &series jammy
applications:
ubuntu: # used to test mounts
charm: ch:ubuntu
num_units: 2
ceph-fs:
charm: ../../../ceph-fs.charm
num_units: 1
options:
source: *openstack-origin
pool-type: erasure-coded
ec-profile-k: 4
ec-profile-m: 2
ceph-osd:
charm: ch:ceph-osd
num_units: 6
storage:
osd-devices: 'cinder,10G'
options:
osd-devices: '/dev/test-non-existent'
source: *openstack-origin
channel: latest/edge
ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
monitor-count: '3'
source: *openstack-origin
channel: latest/edge
relations:
- - 'ceph-mon:mds'
- 'ceph-fs:ceph-mds'
- - 'ceph-osd:mon'
- 'ceph-mon:osd'

View File

@ -3,12 +3,13 @@ variables:
local_overlay_enabled: False local_overlay_enabled: False
series: &series jammy series: &series noble
applications: applications:
ubuntu: # used to test mounts ubuntu: # used to test mounts
charm: ch:ubuntu charm: ch:ubuntu
num_units: 2 num_units: 2
series: jammy
ceph-fs: ceph-fs:
charm: ../../../ceph-fs.charm charm: ../../../ceph-fs.charm
num_units: 1 num_units: 1

View File

@ -1,12 +1,8 @@
charm_name: ceph-fs charm_name: ceph-fs
gate_bundles: gate_bundles:
- focal-xena - noble-caracal
- focal-yoga
- jammy-yoga
- jammy-bobcat
- mantic-bobcat
smoke_bundles: smoke_bundles:
- focal-xena - noble-caracal
# configure: # configure:
# - zaza.openstack.charm_tests.glance.setup.add_lts_image # - zaza.openstack.charm_tests.glance.setup.add_lts_image
# - zaza.openstack.charm_tests.neutron.setup.basic_overcloud_network # - zaza.openstack.charm_tests.neutron.setup.basic_overcloud_network

View File

@ -6,32 +6,28 @@
[tox] [tox]
envlist = pep8 envlist = pep8
skipsdist = True
# NOTE: Avoid build/test env pollution by not enabling sitepackages. # NOTE: Avoid build/test env pollution by not enabling sitepackages.
sitepackages = False sitepackages = False
# NOTE: Avoid false positives by not skipping missing interpreters. # NOTE: Avoid false positives by not skipping missing interpreters.
skip_missing_interpreters = False 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
[testenv] [testenv]
# We use tox mainly for virtual environment management for test requirements
# and do not install the charm code as a Python package into that environment.
# Ref: https://tox.wiki/en/latest/config.html#skip_install
skip_install = True
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0 PYTHONHASHSEED=0
allowlist_externals = juju allowlist_externals = juju
passenv = HOME TERM CS_* OS_* TEST_* passenv =
deps = -r{toxinidir}/test-requirements.txt HOME
install_command = TERM
pip install {opts} {packages} CS_*
OS_*
TEST_*
deps =
-c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements.txt
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3

View File

@ -9,3 +9,6 @@ git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack
git+https://github.com/openstack/charms.ceph.git#egg=charms.ceph git+https://github.com/openstack/charms.ceph.git#egg=charms.ceph
git+https://github.com/juju/charm-helpers.git#egg=charmhelpers git+https://github.com/juju/charm-helpers.git#egg=charmhelpers
# https://github.com/canonical/charms.reactive/pull/260
git+https://github.com/canonical/charms.reactive.git#egg=charms.reactive

68
tox.ini
View File

@ -5,50 +5,36 @@
# https://github.com/openstack-charmers/release-tools # https://github.com/openstack-charmers/release-tools
[tox] [tox]
skipsdist = True
envlist = pep8,py3 envlist = pep8,py3
# NOTE: Avoid build/test env pollution by not enabling sitepackages. # NOTE: Avoid build/test env pollution by not enabling sitepackages.
sitepackages = False sitepackages = False
# NOTE: Avoid false positives by not skipping missing interpreters. # NOTE: Avoid false positives by not skipping missing interpreters.
skip_missing_interpreters = False 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
tox < 4.0.0
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.18.0
[testenv] [testenv]
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0 PYTHONHASHSEED=0
TERM=linux TERM=linux
LAYER_PATH={toxinidir}/layers CHARM_LAYERS_DIR={toxinidir}/layers
INTERFACE_PATH={toxinidir}/interfaces CHARM_INTERFACES_DIR={toxinidir}/interfaces
JUJU_REPOSITORY={toxinidir}/build JUJU_REPOSITORY={toxinidir}/build
passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY passenv =
install_command = no_proxy
{toxinidir}/pip.sh install {opts} {packages} http_proxy
https_proxy
CHARM_INTERFACES_DIR
CHARM_LAYERS_DIR
JUJU_REPOSITORY
allowlist_externals = allowlist_externals =
charmcraft charmcraft
bash bash
tox tox
rename.sh {toxinidir}/rename.sh
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
[testenv:build] [testenv:build]
basepython = python3 basepython = python3
deps = -r{toxinidir}/build-requirements.txt
commands = commands =
charmcraft clean charmcraft clean
charmcraft -v pack charmcraft -v pack
@ -57,7 +43,7 @@ commands =
[testenv:build-reactive] [testenv:build-reactive]
basepython = python3 basepython = python3
commands = commands =
charm-build --log-level DEBUG --use-lock-file-branches -o {toxinidir}/build/builds src {posargs} charm-build --log-level DEBUG --use-lock-file-branches --binary-wheels-from-source -o {toxinidir}/build/builds src {posargs}
[testenv:add-build-lock-file] [testenv:add-build-lock-file]
basepython = python3 basepython = python3
@ -66,32 +52,16 @@ commands =
[testenv:py3] [testenv:py3]
basepython = python3 basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps =
-c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs} commands = stestr run --slowest {posargs}
[testenv:py35] [testenv:py310]
basepython = python3.5 basepython = python3.10
deps = -r{toxinidir}/test-requirements.txt deps =
commands = stestr run --slowest {posargs} -c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements.txt
[testenv:py36]
basepython = python3.6
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:py37]
basepython = python3.7
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:py38]
basepython = python3.8
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:py39]
basepython = python3.9
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs} commands = stestr run --slowest {posargs}
[testenv:pep8] [testenv:pep8]