Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1b77a80

Browse files
bcallerBen Caller
authored and
Ben Caller
committed
Tox, travis and requirements
Requirements: Requirements files aren't used. Requirements.txt and setup.py had odd requirements that I can't see used anywhere. Requirements-dev.txt had conflicting packages (flake8 wants specific versions of pyflakes and pycodestyle). Tox & travis: Split tox into a test, coverage and lint phase. Run either: tox tox -e py36 tox -e cover tox -e lint Tox and travis will now fail the lint / build on flake8 errors to avoid non-compliant code being merged. (--exit-zero removed) Coverage will fail for now, so let's set it really low in travis for now. McCabe complexity is annoying and dealt with better by codeclimate so I bumped it up from 10 to 11 so it won't fail at the moment.
1 parent f18367d commit 1b77a80

File tree

5 files changed

+22
-27
lines changed

5 files changed

+22
-27
lines changed

‎.travis.yml‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ language: python
22
python:
33
- "3.6"
44
install:
5-
- pip install -r requirements.txt
6-
- pip install codeclimate-test-reporter flake8
5+
- pip install codeclimate-test-reporter 'coverage>=4.0,<4.4' flake8
76
before_script:
87
# stop the build if there are Python syntax errors or undefined names
98
- flake8 . --count --exclude=examples --select=E901,E999,F821,F822,F823 --show-source --statistics
10-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
11-
- flake8 . --count --exclude=examples --exit-zero --max-complexity=10 --max-line-length=127 --statistics
129
script:
13-
- python -m tests
1410
- coverage run -m tests
11+
- flake8 . --count --exclude=examples --max-complexity=11 --max-line-length=127 --show-source --statistics
12+
- coverage report --include=tests/* --fail-under 100
13+
- coverage report --include=pyt/* --fail-under 90
1514
after_script:
1615
- codeclimate-test-reporter

‎requirements-dev.txt‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎requirements.txt‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎setup.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030
'Programming Language :: Python :: 3.6'
3131
],
3232
keywords=['security', 'vulnerability', 'web', 'flask', 'django', 'static-analysis', 'program-analysis'],
33-
install_requires=[
34-
'graphviz>=0.4.10',
35-
'requests>=2.12',
36-
'GitPython>=2.0.8'
37-
],
33+
install_requires=[],
3834
entry_points={
3935
'console_scripts': [
4036
'pyt = pyt:main'

‎tox.ini‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
[tox]
2-
envlist = py36
2+
envlist = py36,cover,lint
33

44
[testenv]
5+
deps = mock
6+
commands =
7+
python -m tests
8+
9+
[testenv:cover]
510
whitelist_externals = coverage
6-
deps = -rrequirements-dev.txt
11+
deps =
12+
coverage>=4.0,<4.4
13+
mock
714
commands =
815
coverage erase
916
coverage run tests
1017
coverage report --include=tests/* --fail-under 100
11-
coverage report --include=pyt/* --fail-under 91
18+
coverage report --include=pyt/* --fail-under 90
19+
20+
[testenv:lint]
21+
deps =
22+
flake8
23+
pre-commit
24+
commands =
1225
pre-commit run
13-
flake8 . --count --exclude=examples,venv,.tox --select=E901,E999,F821,F822,F823 --show-source --statistics
14-
flake8 . --count --exclude=examples,venv,.tox,dist --exit-zero --max-complexity=10 --max-line-length=127 --statistics
26+
flake8 . --count --exclude=examples,.env,venv,.tox --show-source --statistics --max-complexity=11 --max-line-length=127 --statistics

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /