Skip to content

Commit

Permalink
Adopts use of module calling method for tools
Browse files Browse the repository at this point in the history
Avoid annoying warnigns raised by tox about externals when sitepackages
is enabled, mainly because these tools where already found installed
as system packages.

Also simplifies the whitelist_externals usage as there is no real
need to have more than one place to define them.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
  • Loading branch information
1efty authored and ssbarnea committed Apr 10, 2019
1 parent cf2890f commit 13d273a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ extras =
commands_pre =
find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -path '*/__pycache__/*' -name '*.py[c|o]' -delete
commands =
unit: pytest test/unit/ --cov={toxinidir}/molecule/ --no-cov-on-fail {posargs}
functional: pytest test/functional/ {posargs}
lint: flake8
lint: yamllint -s test/ molecule/
unit: python -m pytest test/unit/ --cov={toxinidir}/molecule/ --no-cov-on-fail {posargs}
functional: python -m pytest test/functional/ {posargs}
lint: python -m flake8
lint: python -m yamllint -s test/ molecule/
whitelist_externals =
find
rm
sh
# Enabling sitepackages is needed in order to avoid encountering exceptions
# caused by missing selinux python bindinds in ansible modules like template.
# Selinux python bindings are binary and they cannot be installed using pip
Expand All @@ -68,15 +70,15 @@ usedevelop = false

[testenv:format]
commands =
yapf -i -r molecule/ test/
python -m yapf -i -r molecule/ test/
deps = yapf>=0.25.0,<0.27
extras =
skip_install = true
usedevelop = false

[testenv:format-check]
commands =
yapf -d -r molecule/ test/
python -m yapf -d -r molecule/ test/
deps = {[testenv:format]deps}
extras = {[testenv:format]extras}
skip_install = true
Expand All @@ -100,7 +102,7 @@ usedevelop = False
# Ref: https://twitter.com/di_codes/status/1044358639081975813
commands =
python -m setup checkdocs check --metadata --restructuredtext --strict --verbose
twine check .tox/dist/*
python -m twine check .tox/dist/*

[testenv:build-docker]
# skip under Windows
Expand All @@ -123,9 +125,6 @@ commands =
--pull --rm \
{posargs:-t ansible/molecule:$TAG} .\
'
whitelist_externals =
sh


[testenv:build-dists-local]
description =
Expand Down Expand Up @@ -156,6 +155,3 @@ setenv =
commands =
rm -rfv {toxinidir}/dist/
{[testenv:build-dists-local]commands}
whitelist_externals =
rm
{[testenv]whitelist_externals}

0 comments on commit 13d273a

Please sign in to comment.