# Copyright (c) 2020 6WIND S.A. # SPDX-License-Identifier: BSD-3-Clause [tox] envlist = format,lint,py{36,37,38,39,310,311,312,py3},coverage skip_missing_interpreters = true isolated_build = true distdir = {toxinidir}/dist [tox:.package] basepython = python3 [testenv] description = Compile extension and run tests against {envname}. changedir = tests/ install_command = {toxinidir}/tox-install.sh {toxworkdir} {opts} {packages} setenv = SYSREPO_SHM_PREFIX = tox_{envname} SYSREPO_REPOSITORY_PATH = {envdir}/etc/sysrepo allowlist_externals = /bin/rm /usr/bin/rm /usr/bin/find {toxinidir}/tox-install.sh commands = rm -rf '{env:SYSREPO_REPOSITORY_PATH}' -find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete python -Wd -m unittest discover -c -find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete rm -rf '{env:SYSREPO_REPOSITORY_PATH}' [testenv:coverage] changedir = . deps = coverage install_command = {toxinidir}/tox-install.sh {envdir} {opts} {packages} setenv = SYSREPO_SHM_PREFIX = tox_{envname} SYSREPO_REPOSITORY_PATH = {envdir}/etc/sysrepo allowlist_externals = /bin/rm /usr/bin/rm /usr/bin/find {toxinidir}/tox-install.sh commands = rm -rf '{env:SYSREPO_REPOSITORY_PATH}' -find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete python -Wd -m coverage run -m unittest discover -c tests/ -find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete rm -rf '{env:SYSREPO_REPOSITORY_PATH}' python -m coverage report python -m coverage html python -m coverage xml [testenv:format] basepython = python3 description = Format python code using isort and black. changedir = . deps = black~=23.12.1 isort~=5.13.2 skip_install = true install_command = python3 -m pip install {opts} {packages} allowlist_externals = /bin/sh /usr/bin/sh commands = sh -ec 'python3 -m isort $(git ls-files "*.py")' sh -ec 'python3 -m black -t py36 $(git ls-files "*.py")' [testenv:lint] basepython = python3 description = Run coding style checks. install_command = {toxinidir}/tox-install.sh {toxworkdir} {opts} {packages} changedir = . deps = astroid~=3.0.2 black~=23.12.1 flake8~=7.0.0 isort~=5.13.2 pycodestyle~=2.11.1 pyflakes~=3.2.0 pylint~=3.0.3 setuptools~=69.0.3 allowlist_externals = /bin/sh /usr/bin/sh /usr/bin/git {toxinidir}/tox-install.sh commands = sh -ec 'python3 -m black -t py36 --diff --check $(git ls-files "*.py")' sh -ec 'python3 -m flake8 $(git ls-files "*.py")' sh -ec 'python3 -m isort --diff --check-only $(git ls-files "*.py")' sh -ec 'python3 -m pylint $(git ls-files "*.py")'