simplify tox setup

This commit is contained in:
Maximilian Hils 2016-06-28 19:44:25 -07:00
parent 3b53d3e393
commit f69972d13d
4 changed files with 29 additions and 45 deletions

View File

@ -10,23 +10,31 @@ addons:
packages: packages:
- libssl-dev - libssl-dev
env:
global:
- TOXENV=py
- CI_DEPS=codecov>=2.0.5
- CI_COMMANDS=codecov
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- python: 2.7 - python: 2.7
env: TOXENV=py27-ci env: TOXENV=py27
- python: 2.7 - python: 2.7
env: TOXENV=py27-ci NO_ALPN=1 env: TOXENV=py27 NO_ALPN=1
- python: 3.5 - python: 3.5
env: TOXENV=py35-ci env: TOXENV=py35
- python: 3.5 - python: 3.5
env: TOXENV=py35-ci NO_ALPN=1 env: TOXENV=py35 NO_ALPN=1
- language: generic - language: generic
env: TOXENV=py27-ci
os: osx os: osx
osx_image: xcode7.1 osx_image: xcode7.1
git: git:
depth: 9999999 depth: 9999999
env: TOXENV=py27
- python: 3.5
env: TOXENV=lint
- python: 2.7 - python: 2.7
env: TOXENV=docs env: TOXENV=docs
allow_failures: allow_failures:
@ -42,10 +50,7 @@ install:
fi fi
- pip install tox - pip install tox
before_script: script: tox -- --cov netlib --cov mitmproxy --cov pathod
- "tox -e lint"
script: tox
after_success: after_success:
- | - |

View File

@ -1,2 +1,3 @@
https://maximilianhils.com/upload/2016-06/lxml-3.6.0-cp35-cp35m-win32.whl; sys_platform == 'win32' and python_version == '3.5'
-e .[dev,examples,contentviews] -e .[dev,examples,contentviews]
-e ./release -e ./release

View File

@ -110,8 +110,9 @@ setup(
], ],
'contentviews': [ 'contentviews': [
"cssutils>=1.0.1, <1.1", "cssutils>=1.0.1, <1.1",
"protobuf>=2.6.1, <2.7", # TODO: Find Python 3 replacements
"pyamf>=0.8.0, <0.9", # "protobuf>=2.6.1, <2.7",
# "pyamf>=0.8.0, <0.9",
], ],
'examples': [ 'examples': [
"beautifulsoup4>=4.4.1, <4.5", "beautifulsoup4>=4.4.1, <4.5",

45
tox.ini
View File

@ -2,52 +2,29 @@
envlist = py27, py35, docs, lint envlist = py27, py35, docs, lint
[testenv] [testenv]
usedevelop=True
deps = deps =
{env:CI_DEPS:}
-rrequirements.txt -rrequirements.txt
codecov>=2.0.5 passenv = CODECOV_TOKEN CI CI_* TRAVIS TRAVIS_* APPVEYOR APPVEYOR_*
passenv = USERNAME HOME HOMEPATH LOCALAPPDATA CODECOV_TOKEN CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_*
setenv = setenv =
PY3TESTS = test/netlib test/pathod/ test/mitmproxy/script test/mitmproxy/test_contentview.py test/mitmproxy/test_custom_contentview.py test/mitmproxy/test_app.py test/mitmproxy/test_controller.py test/mitmproxy/test_fuzzing.py test/mitmproxy/test_script.py test/mitmproxy/test_web_app.py test/mitmproxy/test_utils.py test/mitmproxy/test_stateobject.py test/mitmproxy/test_cmdline.py test/mitmproxy/test_contrib_tnetstring.py test/mitmproxy/test_proxy.py test/mitmproxy/test_protocol_http1.py test/mitmproxy/test_platform_pf.py TESTS = test/
HOME = {envtmpdir}
[testenv:py27]
commands = commands =
py.test -n 8 --timeout 60 [] py.test -n 4 --timeout 60 {posargs} {env:TESTS}
{env:CI_COMMANDS:python -c ""}
[testenv:py35] [testenv:py35]
# remove bash & pipe & grep hack after cryptography ships with openssl 1.1.0 setenv =
whitelist_externals = bash TESTS = test/netlib test/pathod/ test/mitmproxy/script test/mitmproxy/test_contentview.py test/mitmproxy/test_custom_contentview.py test/mitmproxy/test_app.py test/mitmproxy/test_controller.py test/mitmproxy/test_fuzzing.py test/mitmproxy/test_script.py test/mitmproxy/test_web_app.py test/mitmproxy/test_utils.py test/mitmproxy/test_stateobject.py test/mitmproxy/test_cmdline.py test/mitmproxy/test_contrib_tnetstring.py test/mitmproxy/test_proxy.py test/mitmproxy/test_protocol_http1.py test/mitmproxy/test_platform_pf.py
commands =
bash -c 'set -o pipefail ; py.test -n 8 --timeout 60 {env:PY3TESTS:} 2>&1 | grep -v Cryptography_locking_cb'
[testenv:py27-ci]
commands =
py.test --cov netlib --cov mitmproxy --cov pathod --timeout 60
codecov -e TOXENV
[testenv:py35-ci]
# remove bash & pipe & grep hack after cryptography ships with openssl 1.1.0
whitelist_externals = bash
commands =
bash -c 'set -o pipefail ; py.test --cov netlib --cov mitmproxy --cov pathod --timeout 60 {env:PY3TESTS:} 2>&1 | grep -v Cryptography_locking_cb'
codecov -e TOXENV
[testenv:py35-ci-win]
deps =
https://snapshots.mitmproxy.org/misc/lxml-3.6.0-cp35-cp35m-win32.whl
codecov>=2.0.5
.[dev]
commands =
py.test --cov netlib --cov mitmproxy --cov pathod --timeout 60 {env:PY3TESTS:}
codecov -e TOXENV
[testenv:docs] [testenv:docs]
basepython = python2.7 basepython = python2.7
whitelist_externals = make whitelist_externals = make
changedir = docs changedir = docs
setenv = SPHINXOPTS="-W" commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
commands = make -e html
[testenv:lint] [testenv:lint]
basepython = python2.7 basepython = python
deps = flake8>=2.6.2, <3 deps = flake8>=2.6.2, <3
commands = flake8 --jobs 8 --count mitmproxy netlib pathod examples test commands = flake8 --jobs 8 --count mitmproxy netlib pathod examples test