diff --git a/.zuul.yaml b/.zuul.yaml index 0eed196..23bf5f6 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,4 @@ - project: templates: - - openstack-python3-ussuri-jobs + - openstack-python3-charm-zed-jobs - openstack-cover-jobs diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 0000000..17575d9 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,4 @@ +libffi-dev [platform:dpkg] +libpq-dev [platform:dpkg] +libxml2-dev [platform:dpkg] +libxslt1-dev [platform:dpkg] diff --git a/charmcraft.yaml b/charmcraft.yaml index 4968216..68b3442 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -2,24 +2,21 @@ type: charm parts: charm: - build-packages: - - tox - - git - - python3-dev - override-build: | - apt-get install ca-certificates -y - tox -e build-reactive - override-stage: | - echo "Copying charm to staging area: $CHARMCRAFT_STAGE" - NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds) - cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/ - override-prime: | - # For some reason, the normal priming chokes on the fact that there's a - # hooks directory. - cp -r $CHARMCRAFT_STAGE/* . + source: src/ + plugin: reactive + build-snaps: + - charm + build-environment: + - CHARM_INTERFACES_DIR: /root/project/interfaces/ + - CHARM_LAYERS_DIR: /root/project/layers/ bases: - - name: ubuntu - channel: "20.04" - architectures: - - amd64 + - build-on: + - name: ubuntu + channel: "22.04" + architectures: + - amd64 + run-on: + - name: ubuntu + channel: "22.04" + architectures: [amd64, s390x, ppc64el, arm64] diff --git a/osci.yaml b/osci.yaml index 6076732..d0dd4e6 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,46 +1,34 @@ - project: templates: - - charm-unit-jobs-py38 - - charm-unit-jobs-py39 + - charm-unit-jobs-py310 check: jobs: - - focal-basic - - impish-basic: - voting: false - - jammy-basic: + - jammy-basic + - kinetic-basic: voting: false vars: needs_charm_build: true charm_build_name: pacemaker-remote build_type: charmcraft + charmcraft_channel: 2.0/stable -- job: - name: focal-basic - parent: func-target - dependencies: - - osci-lint - - tox-py38 - - tox-py39 - - charm-build - vars: - tox_extra_args: focal-basic -- job: - name: impish-basic - parent: func-target - dependencies: - - osci-lint - - tox-py38 - - tox-py39 - - charm-build - vars: - tox_extra_args: impish-basic - job: name: jammy-basic parent: func-target dependencies: - osci-lint - - tox-py38 - - tox-py39 + - name: tox-py310 + soft: true - charm-build vars: tox_extra_args: jammy-basic +- job: + name: kinetic-basic + parent: func-target + dependencies: + - osci-lint + - name: tox-py310 + soft: true + - charm-build + vars: + tox_extra_args: kinetic-basic diff --git a/requirements.txt b/requirements.txt index a68620f..b3dc23f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,16 +8,13 @@ # requirements.txt setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 -# Build requirements -cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. -charm-tools==2.8.3 +# NOTE: newer versions of cryptography require a Rust compiler to build, +# see +# * https://github.com/openstack-charmers/zaza/issues/421 +# * https://mail.python.org/pipermail/cryptography-dev/2021-January/001003.html +# +cryptography<3.4 + +git+https://github.com/juju/charm-tools.git simplejson - -# Newer versions use keywords that didn't exist in python 3.5 yet (e.g. -# "ModuleNotFoundError") -# 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 -importlib-metadata<3.0.0; python_version < '3.6' -importlib-resources<3.0.0; python_version < '3.6' diff --git a/src/metadata.yaml b/src/metadata.yaml index 7fb571e..beb71a9 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -7,8 +7,7 @@ description: | tags: - openstack series: -- focal -- impish +- jammy requires: juju-info: interface: juju-info diff --git a/src/tests/bundles/focal-basic.yaml b/src/tests/bundles/focal-basic.yaml deleted file mode 100644 index a2b5993..0000000 --- a/src/tests/bundles/focal-basic.yaml +++ /dev/null @@ -1,37 +0,0 @@ -series: focal - -local_overlay_enabled: False - -applications: - - api: - charm: ch:ubuntu - num_units: 3 - - hacluster: - charm: ch:hacluster - options: - corosync_transport: unicast - cluster_count: 3 - channel: latest/edge - - compute: - charm: ch:ubuntu - num_units: 1 - - pacemaker-remote: - charm: ../../../pacemaker-remote.charm - options: - enable-stonith: False - enable-resources: False - -relations: - - - - 'compute:juju-info' - - 'pacemaker-remote:juju-info' - - - - 'api:juju-info' - - 'hacluster:juju-info' - - - - 'hacluster:pacemaker-remote' - - 'pacemaker-remote:pacemaker-remote' diff --git a/src/tests/bundles/impish-basic.yaml b/src/tests/bundles/kinetic-basic.yaml similarity index 97% rename from src/tests/bundles/impish-basic.yaml rename to src/tests/bundles/kinetic-basic.yaml index 2799c1d..d786142 100644 --- a/src/tests/bundles/impish-basic.yaml +++ b/src/tests/bundles/kinetic-basic.yaml @@ -1,4 +1,4 @@ -series: impish +series: kinetic local_overlay_enabled: False diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index e51d1e2..29537f8 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -7,15 +7,14 @@ configure: - zaza.charm_tests.noop.setup.basic_setup gate_bundles: - - focal-basic - - impish-basic + - jammy-basic smoke_bundles: - - focal-basic + - jammy-basic dev_bundles: - - impish-basic - jammy-basic + - kinetic-basic target_deploy_status: # NOTE(lourot): cs:ubuntu has now an empty status message when ready: @@ -30,5 +29,5 @@ tests_options: force_deploy: # NOTE(lourot): cs:ubuntu doesn't support hirsute+ officially in its # metadata: - - impish-basic - jammy-basic + - kinetic-basic diff --git a/test-requirements.txt b/test-requirements.txt index a11a7d0..a7936e6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,6 @@ # https://github.com/openstack-charmers/release-tools # pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here. -cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 stestr>=2.2.0 @@ -13,25 +12,10 @@ stestr>=2.2.0 # https://github.com/mtreinish/stestr/issues/145 cliff<3.0.0 -# Dependencies of stestr. Newer versions use keywords that didn't exist in -# python 3.5 yet (e.g. "ModuleNotFoundError") -importlib-metadata<3.0.0; python_version < '3.6' -importlib-resources<3.0.0; python_version < '3.6' - -# Some Zuul nodes sometimes pull newer versions of these dependencies which -# dropped support for python 3.5: -osprofiler<2.7.0;python_version<'3.6' -stevedore<1.31.0;python_version<'3.6' -debtcollector<1.22.0;python_version<'3.6' -oslo.utils<=3.41.0;python_version<'3.6' - requests>=2.18.4 charms.reactive -# Newer mock seems to have some syntax which is newer than python3.5 (e.g. -# f'{something}' -mock>=1.2,<4.0.0; python_version < '3.6' -mock>=1.2; python_version >= '3.6' +mock>=1.2 nose>=1.3.7 coverage>=3.6 diff --git a/tox.ini b/tox.ini index 2d60b8a..bdde110 100644 --- a/tox.ini +++ b/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 = 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 = @@ -50,7 +48,7 @@ basepython = python3 deps = -r{toxinidir}/build-requirements.txt commands = charmcraft clean - charmcraft -v build + charmcraft -v pack {toxinidir}/rename.sh [testenv:build-reactive] @@ -68,35 +66,15 @@ basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:py35] -basepython = python3.5 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - -[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 +[testenv:py310] +basepython = python3.10 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} [testenv:pep8] basepython = python3 deps = flake8==3.9.2 - charm-tools==2.8.3 + git+https://github.com/juju/charm-tools.git commands = flake8 {posargs} src unit_tests [testenv:func-target]