Skip to content

Commit

Permalink
Merge pull request #601 from freyes/py311-support
Browse files Browse the repository at this point in the history
Add Python 3.11 support
  • Loading branch information
ajkavanagh authored May 31, 2023
2 parents 6d79cf1 + 2483be5 commit b2f2b46
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v1
Expand Down
3 changes: 0 additions & 3 deletions pip.sh

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ python-neutronclient
python-novaclient
python-octaviaclient
python-swiftclient
tenacity
tenacity>8.2.0
paramiko
python-libmaas
requests<2.26 # pin for py3.5 support
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'juju<3.0',
'juju-wait',
'PyYAML',
'tenacity',
'tenacity>8.2.0',
'python-libmaas',
]

Expand Down
11 changes: 5 additions & 6 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
aiounittest
flake8>=2.2.4
flake8>=5 # Python 3.8 compatibility in pyflakes 2.1.0+
flake8-docstrings
flake8-per-file-ignores
pydocstyle<4.0.0
coverage
mock>=1.2
# For some reason the PyPi distributed wheel of nose differ from the one on
# GitHub, and it does not work with Python 3.10.
nose>=1.3.7;python_version<'3.10'
git+https://github.com/nose-devs/nose.git@release_1.3.7#egg=nose;python_version=='3.10'
pytest
pytest-cov
pytest-asyncio

# TODO: these requirements should be mocked out in unit_tests/__init__.py
async_generator
jinja2
keystoneauth1
oslo.config
python-novaclient
tenacity
tenacity>8.2.0
# pinned until 3.0 regressions are handled: https://github.com/openstack-charmers/zaza/issues/545
juju<3.0
32 changes: 14 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@
envlist = pep8,py3
skipsdist = True

# 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.2.0

[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
whitelist_external = juju
passenv = HOME TERM CS_* OS_* TEST_*
deps = -r{toxinidir}/test-requirements.txt
install_command =
{toxinidir}/pip.sh install {opts} {packages}
commands = nosetests --with-coverage --processes=0 --cover-package=zaza {posargs} {toxinidir}/unit_tests
setenv =
VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
allowlist_external =
juju
passenv =
HOME
TERM
CS_*
OS_*
TEST_*
deps =
-r{toxinidir}/test-requirements.txt
commands = pytest --cov=./zaza/ {posargs} {toxinidir}/unit_tests

[testenv:py3]
basepython = python3
Expand Down
2 changes: 2 additions & 0 deletions unit_tests/test_zaza_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import mock
import pytest
import unittest

import unit_tests.utils as ut_utils
Expand All @@ -25,6 +26,7 @@ def tearDownModule():
zaza.clean_up_libjuju_thread()


@pytest.mark.asyncio
class TestController(ut_utils.BaseTestCase):

def setUp(self):
Expand Down
2 changes: 2 additions & 0 deletions unit_tests/test_zaza_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import concurrent
import datetime
import mock
import pytest
import yaml

import unit_tests.utils as ut_utils
Expand Down Expand Up @@ -100,6 +101,7 @@ def tearDownModule():
}}}}}}


@pytest.mark.asyncio
class TestModel(ut_utils.BaseTestCase):

def setUp(self):
Expand Down

0 comments on commit b2f2b46

Please sign in to comment.