Skip to content

Commit

Permalink
Add constraints to tox.ini files under global/**
Browse files Browse the repository at this point in the history
The constraints file allows globally pinning the versions used by the
tox testing environments and posibly override this by zosci[0]

[0] openstack-charmers/zosci-config#324

Depends-On: openstack-charmers/zaza-openstack-tests#1184
  • Loading branch information
freyes committed Feb 19, 2024
1 parent 80e4e13 commit 36378db
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 23 deletions.
27 changes: 20 additions & 7 deletions global/classic-zaza/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ passenv =
CS_*
OS_*
TEST_*
deps = -r{toxinidir}/test-requirements-py38.txt
TOX_CONSTRAINTS_FILE
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py38.txt

[testenv:build]
basepython = python3
Expand All @@ -49,28 +52,38 @@ commands =

[testenv:py38]
basepython = python3.8
deps = -r{toxinidir}/merged-requirements-py38.txt
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py38.txt

[testenv:py310]
basepython = python3.10
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt

[testenv:py3]
basepython = python3
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt

[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
git+https://github.com/juju/charm-tools.git
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
flake8==3.9.2
git+https://github.com/juju/charm-tools.git
commands = flake8 {posargs} hooks unit_tests tests actions lib files
charm-proof

[testenv:cover]
# Technique based heavily upon
# https://github.com/openstack/nova/blob/master/tox.ini
basepython = python3
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt
setenv =
{[testenv]setenv}
PYTHON=coverage run
Expand Down
25 changes: 19 additions & 6 deletions global/ops-zaza/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,43 @@ passenv =
CS_*
OS_*
TEST_*
deps = -r{toxinidir}/merged-requirements-py38.txt
TOX_CONSTRAINTS_FILE
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py38.txt

[testenv:py38]
basepython = python3.8
deps = -r{toxinidir}/merged-requirements-py38.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py38.txt

[testenv:py310]
basepython = python3.10
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt

[testenv:py3]
basepython = python3
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt

[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
flake8==3.9.2
commands = flake8 {posargs} hooks unit_tests tests actions lib files

[testenv:cover]
# Technique based heavily upon
# https://github.com/openstack/nova/blob/master/tox.ini
basepython = python3
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt
setenv =
{[testenv]setenv}
PYTHON=coverage run
Expand Down
22 changes: 17 additions & 5 deletions global/source-zaza/tox-binary-wheels.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ passenv =
CHARM_INTERFACES_DIR
CHARM_LAYERS_DIR
JUJU_REPOSITORY
TOX_CONSTRAINTS_FILE
allowlist_externals =
charmcraft
bash
tox
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py38.txt

[testenv:build]
Expand All @@ -50,29 +52,39 @@ commands =

[testenv:py3]
basepython = python3
deps = -r{toxinidir}/test-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py310.txt
commands = stestr run --slowest {posargs}

[testenv:py38]
basepython = python3.8
deps = -r{toxinidir}/test-requirements-py38.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py38.txt
commands = stestr run --slowest {posargs}

[testenv:py310]
basepython = python3.10
deps = -r{toxinidir}/test-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py310.txt
commands = stestr run --slowest {posargs}

[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
flake8==3.9.2
commands = flake8 {posargs} src unit_tests

[testenv:cover]
# Technique based heavily upon
# https://github.com/openstack/nova/blob/master/tox.ini
basepython = python3
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt
setenv =
{[testenv]setenv}
PYTHON=coverage run
Expand Down
22 changes: 17 additions & 5 deletions global/source-zaza/tox-source-wheels.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ passenv =
CHARM_INTERFACES_DIR
CHARM_LAYERS_DIR
JUJU_REPOSITORY
TOX_CONSTRAINTS_FILE
allowlist_externals =
charmcraft
bash
tox
{toxinidir}/rename.sh
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py38.txt

[testenv:build]
Expand All @@ -52,29 +54,39 @@ commands =

[testenv:py3]
basepython = python3
deps = -r{toxinidir}/test-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py310.txt
commands = stestr run --slowest {posargs}

[testenv:py38]
basepython = python3.8
deps = -r{toxinidir}/test-requirements-py38.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py38.txt
commands = stestr run --slowest {posargs}

[testenv:py310]
basepython = python3.10
deps = -r{toxinidir}/test-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/test-requirements-py310.txt
commands = stestr run --slowest {posargs}

[testenv:pep8]
basepython = python3
deps = flake8==3.9.2
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
flake8==3.9.2
commands = flake8 {posargs} src unit_tests

[testenv:cover]
# Technique based heavily upon
# https://github.com/openstack/nova/blob/master/tox.ini
basepython = python3
deps = -r{toxinidir}/merged-requirements-py310.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://raw.githubusercontent.com/openstack-charmers/zaza-openstack-tests/master/constraints/constraints-2024.1.txt}
-r{toxinidir}/merged-requirements-py310.txt
setenv =
{[testenv]setenv}
PYTHON=coverage run
Expand Down

0 comments on commit 36378db

Please sign in to comment.