201 lines
4.7 KiB
INI
201 lines
4.7 KiB
INI
# Tox configuration file
|
|
#
|
|
# For more information, see https://tox.readthedocs.org
|
|
#
|
|
# Run it with
|
|
# a) all targets
|
|
# $ tox
|
|
#
|
|
# b) with specific targets (build only documentation):
|
|
# $ tox -e doc
|
|
#
|
|
|
|
[tox]
|
|
skip_missing_interpreters = True
|
|
skipsdist = True
|
|
envlist =
|
|
check,
|
|
unit_py3_7,
|
|
unit_py3_6,
|
|
packagedoc,
|
|
devel
|
|
|
|
|
|
[testenv]
|
|
whitelist_externals = *
|
|
basepython =
|
|
{check,devel,packagedoc,doc,doc_travis,doc_suse,doc_schema}: python3
|
|
unit_py3_7: python3.7
|
|
unit_py3_6: python3.6
|
|
envdir =
|
|
{check,devel,packagedoc,doc,doc_travis,doc_suse,doc_schema}: {toxworkdir}/3
|
|
unit_py3_7: {toxworkdir}/3.7
|
|
unit_py3_6: {toxworkdir}/3.6
|
|
passenv =
|
|
*
|
|
usedevelop = True
|
|
deps =
|
|
-r.virtualenv.dev-requirements.txt
|
|
|
|
|
|
# Unit Test run with basepython set to 3.6
|
|
[testenv:unit_py3_6]
|
|
skip_install = True
|
|
usedevelop = True
|
|
setenv =
|
|
PYTHONPATH={toxinidir}/test
|
|
PYTHONUNBUFFERED=yes
|
|
WITH_COVERAGE=yes
|
|
passenv =
|
|
*
|
|
deps = {[testenv]deps}
|
|
changedir=test/unit
|
|
commands =
|
|
bash -c 'cd ../../ && ./setup.py develop'
|
|
pytest --no-cov-on-fail --cov=kiwi \
|
|
--cov-report=term-missing \
|
|
--cov-fail-under=100 --cov-config .coveragerc {posargs}
|
|
|
|
|
|
# Unit Test run with basepython set to 3.7
|
|
[testenv:unit_py3_7]
|
|
skip_install = True
|
|
usedevelop = True
|
|
setenv =
|
|
PYTHONPATH={toxinidir}/test
|
|
PYTHONUNBUFFERED=yes
|
|
WITH_COVERAGE=yes
|
|
passenv =
|
|
*
|
|
deps = {[testenv]deps}
|
|
changedir=test/unit
|
|
commands =
|
|
bash -c 'cd ../../ && ./setup.py develop'
|
|
pytest --doctest-modules --no-cov-on-fail --cov=kiwi \
|
|
--cov-report=term-missing --cov-fail-under=100 \
|
|
--cov-config .coveragerc {posargs}
|
|
|
|
|
|
# Documentation build suitable for local review
|
|
[testenv:doc]
|
|
skip_install = True
|
|
usedevelop = True
|
|
deps = {[testenv]deps}
|
|
changedir=doc
|
|
commands =
|
|
{[testenv:doc.html]commands}
|
|
{[testenv:doc.man]commands}
|
|
|
|
|
|
# Documentation build run suitable for doc deployment in package(rpm)
|
|
[testenv:packagedoc]
|
|
skip_install = True
|
|
usedevelop = True
|
|
deps = {[testenv]deps}
|
|
changedir=doc
|
|
commands =
|
|
{[testenv:doc.latexpdf]commands}
|
|
{[testenv:doc.man]commands}
|
|
|
|
|
|
# Documentation build suitable for doc deployment in travis env
|
|
[testenv:doc_travis]
|
|
skip_install = True
|
|
usedevelop = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
{[testenv:doc.man]commands}
|
|
travis-sphinx --outdir build_travis build --nowarn --source ./source
|
|
bash -c 'touch ./build_travis/.nojekyll'
|
|
bash -c 'cp -a ./source/schema/images ./build_travis'
|
|
|
|
|
|
# Documentation build suitable for SUSE documentation
|
|
[testenv:doc_suse]
|
|
skip_install = True
|
|
usedevelop = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
{[testenv:doc.xml]commands}
|
|
rstxml2docbook -v --no-split -o build/xml/book.xml build/restxml/index.xml
|
|
bash -c 'mkdir -p build/images/src/png && cp -a source/.images/* build/images/src/png'
|
|
cp DC-kiwi build/
|
|
bash -c 'cd build && daps -d DC-kiwi html'
|
|
|
|
|
|
# Documentation build schema documentation
|
|
# Please note an external tool called oxygen is used to build
|
|
# the schema documentation. The tool requires a license which
|
|
# exists for SUSE. Thus this target can only be called inside
|
|
# of a licensed environment and can therefore not be included
|
|
# into the automation pipeline. If you know the schema has
|
|
# changed the call to recreate the schema docs must be done
|
|
# manually
|
|
[testenv:doc_schema]
|
|
skip_install = True
|
|
usedevelop = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
{[testenv:doc.schema]commands}
|
|
|
|
|
|
# Documentation build html result
|
|
[testenv:doc.html]
|
|
skip_install = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
make html
|
|
|
|
|
|
# Documentation build xml result
|
|
[testenv:doc.xml]
|
|
skip_install = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
make xml
|
|
rm -rf build/restxml
|
|
mv build/xml build/restxml
|
|
|
|
|
|
# Documentation build PDF result
|
|
[testenv:doc.latexpdf]
|
|
skip_install = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
make latexpdf
|
|
|
|
|
|
# Documentation build man pages
|
|
[testenv:doc.man]
|
|
skip_install = True
|
|
deps = {[testenv:doc]deps}
|
|
changedir=doc
|
|
commands =
|
|
make man
|
|
|
|
|
|
# Documentation build schema documentation
|
|
[testenv:doc.schema]
|
|
skip_install = True
|
|
deps = {[testenv:doc]deps}
|
|
commands =
|
|
bash -c 'cd {toxinidir}/helper && ./schema_docs.sh'
|
|
|
|
|
|
# Source code quality/integrity check
|
|
[testenv:check]
|
|
deps = {[testenv]deps}
|
|
skip_install = True
|
|
usedevelop = True
|
|
commands =
|
|
flake8 --statistics -j auto --count {toxinidir}/kiwi
|
|
flake8 --statistics -j auto --count {toxinidir}/test/unit
|
|
bash -c 'shellcheck -e SC1091,SC1090,SC2001,SC2174,SC1117 {toxinidir}/dracut/modules.d/*/* -s bash'
|
|
bash -c 'shellcheck -e SC1091,SC1090,SC2001,SC2174,SC1117 {toxinidir}/kiwi/config/functions.sh -s bash'
|