update link to upper-constraints.txt
[optf/osdf.git] / tox.ini
1
2 [tox]
3 skipsdist=True
4 envlist = py3, pylint, flake8diff
5
6 [testenv]
7 allowlist_externals=/bin/cp, /bin/bash, /bin/rm
8 distribute = False
9 basepython=python3
10 setenv   =
11     OSDF_CONFIG_FILE={toxinidir}/test/config/osdf_config.yaml
12 commands =
13     /bin/cp config/slicing_config.yaml test/config/
14     /bin/bash test/functest/scripts/start-simulators.sh
15     coverage run --module pytest --junitxml xunit-results.xml
16     coverage xml --omit=".tox/py3/*","test/*"
17     coverage report -m --omit=".tox/py3/*","test/*"
18     /bin/bash test/functest/scripts/stop-simulators.sh
19     /bin/rm test/config/slicing_config.yaml
20     # TODO: need to update the above "omit" when we package osdf as pip-installable
21 deps = -r{toxinidir}/requirements.txt
22     -r{toxinidir}/test/test-requirements.txt
23     -r{toxinidir}/requirements-osdf.txt
24     -r{toxinidir}/requirements-opteng.txt
25
26 [run]
27 source=./apps/,./osdf/,osdfapp.py,./runtime/,solverapp.py
28
29 [testenv:pylint]
30 allowlist_externals=bash
31 commands = bash -c "pylint --reports=y osdf apps runtime| tee pylint.out"
32
33 [testenv:py3]
34 basepython=python3
35
36 [testenv:flake8diff]
37 basepython=python3
38 allowlist_externals=bash
39 deps = hacking>=2.0.0
40 commands =
41   bash -c "files=$(git diff HEAD^ HEAD --diff-filter=d --name-only | grep -E '(^apps\/|osdf\/|runtime\/)'| grep -E '*\.py$'); if [[ -z $files ]]; then exit 0; else flake8 $files; fi"
42
43 [flake8]
44 select = E,H,W,F
45 max-line-length = 119
46 ignore = W503   #conflict with W504
47 per-file-ignores= apps/pci/optimizers/__init__.py:F401