Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tox, travis and requirements #152

Merged
merged 2 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ language: python
python:
- "3.6"
install:
- pip install -r requirements.txt
- pip install codeclimate-test-reporter flake8
- pip install codeclimate-test-reporter 'coverage>=4.0,<4.4' flake8
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --exclude=examples --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exclude=examples --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- python -m tests
- coverage run -m tests
- flake8 . --count --exclude=examples --max-complexity=11 --max-line-length=127 --show-source --statistics
- coverage report --include=tests/* --fail-under 100
- coverage report --include=pyt/* --fail-under 91
after_script:
- codeclimate-test-reporter
1 change: 0 additions & 1 deletion pyt/usage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import os
import sys
from datetime import datetime


default_blackbox_mapping_file = os.path.join(
Expand Down
8 changes: 0 additions & 8 deletions requirements-dev.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@
'Programming Language :: Python :: 3.6'
],
keywords=['security', 'vulnerability', 'web', 'flask', 'django', 'static-analysis', 'program-analysis'],
install_requires=[
'graphviz>=0.4.10',
'requests>=2.12',
'GitPython>=2.0.8'
],
install_requires=[],
entry_points={
'console_scripts': [
'pyt = pyt:main'
Expand Down
20 changes: 16 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
[tox]
envlist = py36
envlist = py36,cover,lint

[testenv]
deps = mock
commands =
python -m tests

[testenv:cover]
whitelist_externals = coverage
deps = -rrequirements-dev.txt
deps =
coverage>=4.0,<4.4
mock
commands =
coverage erase
coverage run tests
coverage report --include=tests/* --fail-under 100
coverage report --include=pyt/* --fail-under 91
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep it aligned with this as well I suppose.


[testenv:lint]
deps =
flake8
pre-commit
commands =
pre-commit run
flake8 . --count --exclude=examples,venv,.tox --select=E901,E999,F821,F822,F823 --show-source --statistics
flake8 . --count --exclude=examples,venv,.tox,dist --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exclude=examples,.env,venv,.tox --show-source --statistics --max-complexity=11 --max-line-length=127 --statistics