Files
id_configurator/tox.ini
T
2026-09-04 21:58:28 +02:00

82 lines
2.4 KiB
INI

[tox]
env_list = py313,py314,coverage,packaging,publish,module-python
isolated_build = true
requires =
tox>=4
tox-uv>=1
[testenv]
package = wheel
dependency_groups = test
change_dir = {env_tmp_dir}
set_env =
COVERAGE_FILE = {toxworkdir}/coverage/coverage.db
commands =
pytest {tox_root}/tests --cov-config={tox_root}/pyproject.toml --cov-fail-under=0 {posargs}
[testenv:coverage]
package = skip
depends = py313,py314
change_dir = {tox_root}
dependency_groups = test
set_env =
COVERAGE_FILE = {toxworkdir}/coverage/coverage.db
commands =
python3 -m coverage combine
python3 -m coverage xml -o .tox/coverage.xml --ignore
python3 -m coverage report -m --fail-under=94 --ignore --skip-covered
[testenv:packaging]
package = skip
change_dir = {tox_root}
allowlist_externals =
docker
dependency_groups = dev
description =
Generate the docker images for the different platform
depends =
update
commands =
python3 -m id_tools build docker --platform linux/amd64,linux/arm64/v8
[testenv:publish]
package = skip
change_dir = {tox_root}
dependency_groups = dev
description =
Build and publish the image to Docker Hub.
The version is taken from the pyproject.toml file.
Make sure that you have the rights to upload the image to Docker Hub.
commands =
python3 -m uv sync --all-groups --active
python3 -m id_tools build docker --platform linux/amd64,linux/arm64/v8 --push
python3 -m id_tools publication sign-docker
docker =
passenv =
COSIGN_PASSWORD
COSIGN_PRIVATE_KEY
DOCKER_HUB_LOGIN
DOCKER_HUB_TOKEN
[docker:pypi-repo]
dockerfile = {tox_root}/tests/dockerfiles/repos/pypi-repo.Dockerfile
expose =
PYPI_REPO_PORT=8443/tcp
healthcheck_cmd = wget --no-check-certificate -qO- https://127.0.0.1:8443/simple/idconfiguratortestpkg/ || exit 1
healthcheck_interval = 1
healthcheck_retries = 30
healthcheck_timeout = 2
healthcheck_start_period = 1
[testenv:module-python]
package = skip
change_dir = {tox_root}
dependency_groups = dev
docker =
pypi-repo
allowlist_externals =
docker
commands =
python3 -m id_tools test render-config {tox_root}/tests/configs/Python.yaml.tmpl {env_dir}/configs/Python.yaml
docker buildx build --platform linux/amd64 --add-host=host.docker.internal:host-gateway --build-context generated-config={env_dir}/configs -f {tox_root}/tests/dockerfiles/Python.Dockerfile -t id-configurator-python .