478df34b1b
Add py311 in tox file Change-Id: Ide942f1c012654144bdc5bdaf22a0d6013d66e65
170 lines
3.9 KiB
INI
170 lines
3.9 KiB
INI
# Source charm: ./tox.ini
|
|
# 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
|
|
|
|
[tox]
|
|
skipsdist = True
|
|
envlist = pep8,py3
|
|
sitepackages = False
|
|
skip_missing_interpreters = False
|
|
minversion = 3.18.0
|
|
|
|
[vars]
|
|
src_path = {toxinidir}/src/
|
|
tst_path = {toxinidir}/tests/
|
|
lib_path = {toxinidir}/lib/
|
|
pyproject_toml = {toxinidir}/pyproject.toml
|
|
all_path = {[vars]src_path} {[vars]tst_path}
|
|
|
|
[testenv]
|
|
basepython = python3
|
|
setenv =
|
|
PYTHONPATH = {toxinidir}:{[vars]lib_path}:{[vars]src_path}
|
|
passenv =
|
|
HOME
|
|
PYTHONPATH
|
|
install_command =
|
|
pip install {opts} {packages}
|
|
commands = stestr run --slowest {posargs}
|
|
allowlist_externals =
|
|
git
|
|
charmcraft
|
|
{toxinidir}/fetch-libs.sh
|
|
{toxinidir}/rename.sh
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:fmt]
|
|
description = Apply coding style standards to code
|
|
deps =
|
|
black
|
|
isort
|
|
commands =
|
|
isort {[vars]all_path} --skip-glob {[vars]lib_path} --skip {toxinidir}/.tox
|
|
black --config {[vars]pyproject_toml} {[vars]all_path} --exclude {[vars]lib_path}
|
|
|
|
[testenv:build]
|
|
basepython = python3
|
|
deps =
|
|
commands =
|
|
charmcraft -v pack
|
|
{toxinidir}/rename.sh
|
|
|
|
[testenv:fetch]
|
|
basepython = python3
|
|
deps =
|
|
commands =
|
|
{toxinidir}/fetch-libs.sh
|
|
|
|
[testenv:py3]
|
|
basepython = python3
|
|
deps =
|
|
{[testenv]deps}
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[testenv:py38]
|
|
basepython = python3.8
|
|
deps = {[testenv:py3]deps}
|
|
|
|
[testenv:py39]
|
|
basepython = python3.9
|
|
deps = {[testenv:py3]deps}
|
|
|
|
[testenv:py310]
|
|
basepython = python3.10
|
|
deps = {[testenv:py3]deps}
|
|
|
|
[testenv:py311]
|
|
basepython = python3.11
|
|
deps = {[testenv:py3]deps}
|
|
|
|
[testenv:cover]
|
|
basepython = python3
|
|
deps = {[testenv:py3]deps}
|
|
setenv =
|
|
{[testenv]setenv}
|
|
PYTHON=coverage run
|
|
commands =
|
|
coverage erase
|
|
stestr run --slowest {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
coverage report
|
|
|
|
[testenv:pep8]
|
|
description = Alias for lint
|
|
deps = {[testenv:lint]deps}
|
|
commands = {[testenv:lint]commands}
|
|
|
|
[testenv:lint]
|
|
description = Check code against coding style standards
|
|
deps =
|
|
black
|
|
flake8<6 # Pin version until https://github.com/savoirfairelinux/flake8-copyright/issues/19 is merged
|
|
flake8-docstrings
|
|
flake8-copyright
|
|
flake8-builtins
|
|
pyproject-flake8
|
|
pep8-naming
|
|
isort
|
|
codespell
|
|
commands =
|
|
codespell {[vars]all_path}
|
|
# pflake8 wrapper supports config from pyproject.toml
|
|
pflake8 --exclude {[vars]lib_path} --config {toxinidir}/pyproject.toml {[vars]all_path}
|
|
isort --check-only --diff {[vars]all_path} --skip-glob {[vars]lib_path}
|
|
black --config {[vars]pyproject_toml} --check --diff {[vars]all_path} --exclude {[vars]lib_path}
|
|
|
|
[testenv:func-noop]
|
|
basepython = python3
|
|
deps =
|
|
git+https://github.com/openstack-charmers/zaza.git@libjuju-3.1#egg=zaza
|
|
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
|
|
git+https://opendev.org/openstack/tempest.git#egg=tempest
|
|
commands =
|
|
functest-run-suite --help
|
|
|
|
[testenv:func]
|
|
basepython = python3
|
|
deps = {[testenv:func-noop]deps}
|
|
commands =
|
|
functest-run-suite --keep-model
|
|
|
|
[testenv:func-smoke]
|
|
basepython = python3
|
|
deps = {[testenv:func-noop]deps}
|
|
setenv =
|
|
TEST_MODEL_SETTINGS = automatically-retry-hooks=true
|
|
TEST_MAX_RESOLVE_COUNT = 5
|
|
commands =
|
|
functest-run-suite --keep-model --smoke
|
|
|
|
[testenv:func-dev]
|
|
basepython = python3
|
|
deps = {[testenv:func-noop]deps}
|
|
commands =
|
|
functest-run-suite --keep-model --dev
|
|
|
|
[testenv:func-target]
|
|
basepython = python3
|
|
deps = {[testenv:func-noop]deps}
|
|
commands =
|
|
functest-run-suite --keep-model --bundle {posargs}
|
|
|
|
[coverage:run]
|
|
branch = True
|
|
concurrency = multiprocessing
|
|
parallel = True
|
|
source =
|
|
.
|
|
omit =
|
|
.tox/*
|
|
tests/*
|
|
src/templates/*
|
|
|
|
[flake8]
|
|
ignore=E226,W504
|