Skip to content

Commit 0b169d9

Browse files
committed
Use tox
1 parent e35e539 commit 0b169d9

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ before_install:
1111
- sudo chmod a+rw /builds
1212

1313
install:
14-
- pip3 install coverage flake8 -r requirements.txt
15-
- flake8 . --select=E9,F63,F7,F82 --show-source --statistics
16-
- sudo python setup.py install
14+
- pip3 install tox -r requirements.txt
1715

18-
script: coverage run -m pytest tests
16+
script:
17+
- tox -e lint
18+
- tox -e unit

lint-requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
black>=18.9b0
2+
flake8>=3.6.0
3+
pydocstyle>=2.1.1
4+
bandit>=1.5.1

tox.ini

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[tox]
2+
3+
[testenv:unit]
4+
deps =
5+
-rrequirements.txt
6+
pytest
7+
coverage
8+
commands = coverage run --source PSL -m pytest
9+
10+
[testenv:integration]
11+
deps = {[testenv:unit]deps}
12+
commands = coverage run --source PSL -m pytest --integration
13+
14+
[testenv:record]
15+
deps = {[testenv:unit]deps}
16+
commands = coverage run --source PSL -m pytest --record
17+
18+
[testenv:lint]
19+
deps = -rlint-requirements.txt
20+
setenv =
21+
INCLUDE_PSL_FILES = PSL/achan.py PSL/digital_channel.py PSL/logic_analyzer.py PSL/oscilloscope.py PSL/packet_handler.py
22+
commands =
23+
black --check {env:INCLUDE_PSL_FILES}
24+
flake8 --show-source {env:INCLUDE_PSL_FILES}
25+
bandit -q -r {env:INCLUDE_PSL_FILES}
26+
pydocstyle {env:INCLUDE_PSL_FILES}
27+
28+
[testenv:docs]
29+
deps = sphinx>=1.8.4
30+
commands = sphinx-build -d docs/_build/doctrees docs docs/_build/html
31+
32+
[flake8]
33+
max-line-length = 88
34+
max-complexity = 10
35+
select = B,C,E,F,W,T4,B9
36+
ignore = E203,E231,W503 # Conflict with black.
37+
38+
39+
[pydocstyle]
40+
convention = numpy
41+

0 commit comments

Comments
 (0)