tox.ini 1.72 KB
Newer Older
Elad Noor's avatar
Elad Noor committed
1
[tox]
2
envlist = isort, black, flake8, safety, py{38}
Elad Noor's avatar
Elad Noor committed
3 4 5 6 7

[testenv]
setenv =
    PYTHONUNBUFFERED=1
deps =
8
    cobra
Elad Noor's avatar
Elad Noor committed
9 10 11
    pytest
    pytest-cov
    pytest-raises
12
    sbtab>=0.9.73
Elad Noor's avatar
Elad Noor committed
13
commands =
Moritz E. Beber's avatar
Moritz E. Beber committed
14
    pytest --cov=equilibrator_api {posargs: {toxinidir}/tests}
Elad Noor's avatar
Elad Noor committed
15

Moritz E. Beber's avatar
Moritz E. Beber committed
16
[testenv:isort]
Elad Noor's avatar
Elad Noor committed
17 18
skip_install = True
deps=
Moritz E. Beber's avatar
Moritz E. Beber committed
19
    isort
Elad Noor's avatar
Elad Noor committed
20
commands=
Elad Noor's avatar
Elad Noor committed
21
    isort --check --diff {toxinidir}/src/equilibrator_api {toxinidir}/tests
Elad Noor's avatar
Elad Noor committed
22

Moritz E. Beber's avatar
Moritz E. Beber committed
23
[testenv:black]
Elad Noor's avatar
Elad Noor committed
24 25
skip_install = True
deps=
Moritz E. Beber's avatar
Moritz E. Beber committed
26 27 28 29 30 31 32 33 34 35
    black
commands=
    black --check --diff {toxinidir}/src/equilibrator_api {toxinidir}/tests

[testenv:flake8]
skip_install = True
deps=
    flake8
    flake8-docstrings
    flake8-bugbear
Elad Noor's avatar
Elad Noor committed
36
commands=
Moritz E. Beber's avatar
Moritz E. Beber committed
37
    flake8 {toxinidir}/src/equilibrator_api {toxinidir}/tests
Elad Noor's avatar
Elad Noor committed
38 39 40 41 42 43

[testenv:safety]
deps=
    safety
commands=
    safety check
Moritz E. Beber's avatar
Moritz E. Beber committed
44

eladnoor's avatar
eladnoor committed
45 46 47 48 49 50 51 52
[testenv:codecov]
passenv=
    GITLAB_CI CI_BUILD_REF_NAME CI_BUILD_ID CI_BUILD_REPO CI_BUILD_REF CODECOV_TOKEN
deps=
    codecov>=1.4.0
commands=
    codecov

Moritz E. Beber's avatar
Moritz E. Beber committed
53 54 55 56 57 58 59 60 61 62 63 64
[flake8]
max-line-length = 80
exclude =
    __init__.py
    _version.py
# The following conflict with `black` which is the more pedantic.
ignore =
    E203
    W503
    D202

[isort]
Moritz E. Beber's avatar
Moritz E. Beber committed
65 66 67
skip =
    __init__.py
    _version.py
Moritz E. Beber's avatar
Moritz E. Beber committed
68 69 70 71 72 73 74 75 76 77
line_length = 80
indent = 4
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
lines_after_imports = 2
known_first_party = equilibrator_api
known_third_party =
    pytest
Elad Noor's avatar
Elad Noor committed
78
    pyparsing
Moritz E. Beber's avatar
Moritz E. Beber committed
79 80 81
    numpy
    pandas
    unittest
82 83
    path
    slugify
Moritz E. Beber's avatar
Moritz E. Beber committed
84 85 86
    scipy
    optlang
    sbtab
Moritz E. Beber's avatar
Moritz E. Beber committed
87
    equilibrator_cache
Moritz E. Beber's avatar
Moritz E. Beber committed
88 89
    component_contribution

Moritz E. Beber's avatar
Moritz E. Beber committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
[coverage:paths]
source =
    src/equilibrator_api
    */site-packages/equilibrator_api

[coverage:run]
branch = true
parallel = true
omit =
    src/equilibrator_api/_version.py

[coverage:report]
precision = 2
omit =
    src/equilibrator_api/_version.py