Updates for py312 compatibility

- Removed pins to old version of setuptools.
- Added py312 section to tox.ini [testenv]
- Updated flake8 to 7.1.1 instead of 3.9.2
- Fixed pep8 failure in unit test
- Enable upstream testing for py312

Change-Id: Id0b75bd5a7e6954f19dbea25e08187ae62d3c6d9
This commit is contained in:
Jadon Naas 2024-08-21 18:50:28 +00:00
parent ede9f77b83
commit 5a0c525ee5
5 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
- project:
templates:
- openstack-python3-charm-zed-jobs
- openstack-python3-charm-jobs
- openstack-cover-jobs

View File

@ -3,10 +3,6 @@
# 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,
# see

View File

@ -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.
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85
stestr>=2.2.0

View File

@ -69,9 +69,14 @@ basepython = python3.10
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:py312]
basepython = python3.12
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
deps = flake8==7.1.1
git+https://github.com/juju/charm-tools.git
commands = flake8 {posargs} src unit_tests

View File

@ -124,7 +124,8 @@ class TestLibCharmVaultPKI(unit_tests.test_utils.CharmTestCase):
'data': 'data'}
get_local_client.return_value = client_mock
is_ca_ready.return_value = True
sort_sans.side_effect = lambda l: (l[0], l[1])
sort_sans.side_effect = lambda lambda_value: (lambda_value[0],
lambda_value[1])
vault_pki.generate_certificate('server',
'example.com',
([], []),