diff --git a/.travis.yml b/.travis.yml index 079eef72..0638ada6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/pyt/usage.py b/pyt/usage.py index a4ec5d81..7325a7c8 100644 --- a/pyt/usage.py +++ b/pyt/usage.py @@ -1,7 +1,6 @@ import argparse import os import sys -from datetime import datetime default_blackbox_mapping_file = os.path.join( diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 54e84f37..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,8 +0,0 @@ -flake8 -mock -pre-commit -py -pycodestyle -pyflakes -tox -virtualenv diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f7b38d47..00000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -coverage>=4.0, <4.4 -GitPython==2.0.8 -graphviz==0.4.10 -requests~=2.12 diff --git a/setup.py b/setup.py index 39aa9440..17c81594 100644 --- a/setup.py +++ b/setup.py @@ -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' diff --git a/tox.ini b/tox.ini index aa701c72..9ea660f5 100644 --- a/tox.ini +++ b/tox.ini @@ -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 + +[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