tox.ini 1.96 KB
Newer Older
1
[tox]
2
envlist = py27,py3
3 4 5 6 7 8 9

[testenv]
skipdist=True
skip_install=True
deps =
  -rrequirements.txt
  -rtest_requirements.txt
10
setenv =
11
  NGRAPH_CPP_BUILD_PATH = {env:NGRAPH_CPP_BUILD_PATH:{homedir}/ngraph_dist}
12
  NGRAPH_ONNX_IMPORT_ENABLE = {env:NGRAPH_ONNX_IMPORT_ENABLE:"FALSE"}
13 14
  LD_LIBRARY_PATH = {env:LD_LIBRARY_PATH:{homedir}/ngraph_dist/lib}
  DYLD_LIBRARY_PATH = {env:DYLD_LIBRARY_PATH:{homedir}/ngraph_dist/lib}
15
  PYBIND_HEADERS_PATH = {env:PYBIND_HEADERS_PATH:}
16

17
[testenv:py3]
18 19 20 21 22 23 24
deps =
  -rrequirements.txt
  -rtest_requirements.txt
  mypy
  flake8-bugbear
commands=
  {envbindir}/python setup.py develop
25
  flake8 {posargs:pyngraph/ ngraph/ examples/ setup.py}
26
  flake8 --ignore=D100,D101,D102,D103,D104,D105,D107,W503 test/  # ignore lack of docs in tests
27
  mypy --config-file=tox.ini {posargs:pyngraph/ ngraph/ examples/} # Use MyPy in Python 3 only
28 29 30 31 32
  pytest {posargs:test/}

[testenv:py27]
commands=
  {envbindir}/python setup.py develop
33
  flake8 {posargs:pyngraph/ ngraph/ examples/}
34
  flake8 --ignore=D100,D101,D102,D103,D104,D105,D107,W503 test/  # ignore lack of docs in tests
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
  pytest {posargs:test/}

[testenv:devenv]
envdir = devenv
usedevelop = True
deps = -rrequirements.txt

[flake8]
max-line-length=100
max-complexity=7
# ignore:
# D100 - Missing docstring in public module
# D104 - Missing docstring in public package
# D105 - Missing docstring in magic method
# D107 - Missing docstring in __init__
# F401 - module imported but unused
51 52
# W503 - line break before binary operator (prefer line breaks before op, not after)
ignore=D100,D104,D105,D107,F401,W503
53 54 55 56 57 58 59 60 61 62 63 64 65

[mypy]
strict_optional = True
ignore_missing_imports=True
follow_imports=normal
disallow_untyped_defs = True
disallow_untyped_calls = True
check_untyped_defs = True
show_error_context = False
show_column_numbers = True
show_none_errors  = True

# put custom per-file options here in sections that map their names into filenames, e.g. gta_workflow/filename.py is
66
# [mypy-ngraph/filename]
67 68 69

[mypy-test.*]
disallow_untyped_defs = False