-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
184 lines (170 loc) · 4.98 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
[tox]
envlist = py34,py35,py36,py37,horton,pyscf,keras,linters,docs
# Default tests on different environments is pytest
# NOTE: optional dependencies (such as horton, pyscf, keras) are not installed.
[testenv]
deps =
pytest
pytest-cov
commands =
pytest --cov={envsitepackagesdir}/fanpy --cov-branch -k "not slow" --cov-config=tox.ini \
--ignore=./tests/test_network_keras_network.py tests
ignore_errors = true
# TODO: Need tests for horton scripts
[testenv:horton]
deps =
{[testenv]deps}
commands =
pytest -k "horton" --ignore=./tests/test_network_keras_network.py tests
ignore_errors = true
# TODO: Need tests for pyscf scripts
[testenv:pyscf]
deps =
{[testenv]deps}
commands =
pip install pyscf
pytest -k "pyscf" --ignore=./tests/test_network_keras_network.py tests
ignore_errors = true
# FIXME: Cannot only check coverage on a specific file i.e. unable to provide missing the include
# option for coverage.py. Specifying the path in coveragerc [run] include seems to make coverage
# confused
[testenv:keras]
deps =
{[testenv]deps}
commands =
pip install tensorflow==2.2
pytest --cov={envsitepackagesdir}/fanpy --cov-branch tests/test_network_keras_network.py
ignore_errors = true
# Linters
[testenv:readme]
basepython = python3
deps =
readme_renderer
twine
commands =
python setup.py sdist bdist_wheel
twine check dist/*
[testenv:black]
basepython = python3
skip_install = true
deps =
black
commands =
black -l 100 --check ./
black -l 100 --diff ./
[testenv:flake8]
basepython = python3
skip_install = true
deps =
flake8
flake8-docstrings>=0.2.7
flake8-import-order>=0.9
pep8-naming
flake8-colors
commands =
flake8 fanpy/ tests/ setup.py
[testenv:pylint]
basepython = python3
skip_install = true
deps =
pylint
commands =
pylint fanpy/ --rcfile=tox.ini --disable=similarities
[testenv:bandit]
basepython = python3
skip_install = true
deps =
bandit
commands =
bandit -r -s B101 fanpy/
[testenv:linters]
basepython = python3
skip_install = true
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:pylint]deps}
{[testenv:readme]deps}
{[testenv:bandit]deps}
commands =
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:pylint]commands}
{[testenv:readme]commands}
{[testenv:bandit]commands}
ignore_errors = true
# flake8
[flake8]
max-line-length = 100
import-order-style = cryptography
ignore =
# E121 : continuation line under-indented for hanging indent
E121,
# E123 : closing bracket does not match indentation of opening bracket’s line
E123,
# E126 : continuation line over-indented for hanging indent
E126,
# E226 : missing whitespace around arithmetic operator
E226,
# E241 : multiple spaces after ‘,’
# E242 : tab after ‘,’
E24,
# E704 : multiple statements on one line (def)
E704,
# W503 : line break occurred before a binary operator
W503,
# W504 : Line break occurred after a binary operator
W504,
# E203 : Whitespace before ':'
E203,
# D202 : No blank lines allowed after function docstring
D202,
# pylintrc
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
[MESSAGES CONTROL]
disable=
# attribute-defined-outside-init (W0201):
# Attribute %r defined outside __init__ Used when an instance attribute is
# defined outside the __init__ method.
W0201,
# too-many-instance-attributes (R0902):
# Too many instance attributes (%s/%s) Used when class has too many instance
# attributes, try to reduce this to get a simpler (and so easier to use)
# class.
R0902,
# too-many-arguments (R0913):
# Too many arguments (%s/%s) Used when a function or method takes too many
# arguments.
R0913,
# fixme (W0511):
# Used when a warning note as FIXME or XXX is detected.
W0511,
# bad-continuation (C0330):
# Wrong hanging indentation before block (add 4 spaces).
C0330,
# wrong-import-order (C0411):
# %s comes before %s Used when PEP8 import order is not respected (standard
# imports first, then third-party libraries, then local imports)
C0411,
# arguments-differ (W0221):
# Parameters differ from %s %r method Used when a method has a different
# number of arguments than in the implemented interface or in an overridden
# method.
W0221,
# import-error (E0401):
# Unable to import %s Used when pylint has been unable to import a module.
E0401,
# len-as-condition (C1801):
# Do not use `len(SEQUENCE)` to determine if a sequence is empty Used when
# Pylint detects that len(sequence) is being used inside a condition to
# determine if a sequence is empty. Instead of comparing the length to 0,
# rely on the fact that empty sequences are false.
C1801,
# too-many-locals (R0914):
# Too many local variables (%s/%s) Used when a function or method has too
# many local variables.
R0914,
[SIMILARITIES]
min-similarity-lines=5