Updates for py312 compatibility

- Added py312 section to tox.ini [testenv]
- Updated flake8 to 7.1.1 instead of 3.9.2

Also had to fix an issue the newer flake8 found in
hooks/horizon_contexts.py:

  E721 do not compare types, for exact checks use `is` / `is not`

Change-Id: Idd82e9a18e5bd089883aa819f4d6139def3d47cf
This commit is contained in:
Brian Haley 2025-04-03 09:45:21 -04:00
parent 68224fd9a1
commit fed753d3d1
2 changed files with 9 additions and 2 deletions

View File

@ -478,7 +478,7 @@ class LocalSettingsContext(OSContextGenerator):
pass
# if they are the same type, try comparing them.
if type(priority_l) == type(priority_r):
if type(priority_l) is type(priority_r):
try:
return _cmp(priority_l, priority_r)
except TypeError:

View File

@ -49,6 +49,13 @@ commands =
{toxinidir}/rename.sh
charmcraft clean
[testenv:py312]
basepython = python3.12
deps =
-c {env:TEST_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py310]
basepython = python3.10
deps =
@ -65,7 +72,7 @@ deps =
[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} hooks unit_tests tests actions lib files
charm-proof