From b7af84552385fa6daf5f594ffa981f8647f7e755 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 15 Feb 2016 18:12:12 +0100 Subject: [PATCH] fix appveyor, re-introduce requirements.txt --- .appveyor.yml | 10 ++++------ .coveragerc | 11 +++++++++++ .travis.yml | 7 ++----- dev.bat | 6 +----- dev.sh | 4 +--- mitmproxy/setup.py | 5 ++++- pathod/setup.py | 5 ++++- requirements.txt | 4 ++++ 8 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 .coveragerc create mode 100644 requirements.txt diff --git a/.appveyor.yml b/.appveyor.yml index 64a5c8828..2bbf3f12d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,19 +14,17 @@ environment: secure: LPjrtFrWxYhOVGXzfPRV1GjtZE/wHoKq9m/PI6hSalfysUK5p2DxTG9uHlb4Q9qV install: - "pip install --user -U pip setuptools" - - "pip install --user --src .. -r requirements.txt" + - "pip install --user -r requirements.txt" - "python -c \"from OpenSSL import SSL; print(SSL.SSLeay_version(SSL.SSLEAY_VERSION))\"" test_script: - - "py.test -s --cov libmproxy --timeout 30" + - "py.test -s --cov libmproxy --cov netlib --cov libpathod --timeout 30 ./test/" cache: - C:\Users\appveyor\AppData\Local\pip\cache deploy_script: ps: | if($Env:APPVEYOR_REPO_BRANCH -match "master") { - git clone https://github.com/mitmproxy/release.git ..\release - pip install -e ..\release - python ..\release\rtool.py bdist - python ..\release\rtool.py upload-snapshot --bdist + python .\release\rtool.py bdist + python .\release\rtool.py upload-snapshot --bdist } notifications: - provider: Slack diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..f6616fb34 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,11 @@ +[run] +branch = True + +[report] +show_missing = True +include = *libmproxy* *netlib* *libpathod* +exclude_lines = + pragma: nocover + pragma: no cover + raise NotImplementedError() +omit = *contrib*, *tnetstring*, *platform*, *console*, *main.py diff --git a/.travis.yml b/.travis.yml index 1e7f80aa5..f9a6aa664 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,7 @@ matrix: - python: 3.5 env: SCOPE="netlib" - python: 3.5 - env: NO_ALPN=1 - env: SCOPE="netlib" + env: NO_ALPN=1 SCOPE="netlib" - python: 2.7 env: DOCS=1 script: 'cd mitmproxy/docs && make html' @@ -39,9 +38,7 @@ install: brew install python fi - "pip install -U pip setuptools" - - "pip install -e ./netlib[dev]" - - "pip install -e ./pathod[dev]" - - "pip install -e ./mitmproxy[dev,contentviews,examples]" + - "pip install -r requirements.txt" before_script: - "openssl version -a" diff --git a/dev.bat b/dev.bat index 62b76fbd4..d979c73b0 100644 --- a/dev.bat +++ b/dev.bat @@ -5,11 +5,7 @@ virtualenv %VENV% --always-copy if %errorlevel% neq 0 exit /b %errorlevel% call %VENV%\Scripts\activate.bat if %errorlevel% neq 0 exit /b %errorlevel% -pip install -e ./netlib[dev] -if %errorlevel% neq 0 exit /b %errorlevel% -pip install -e ./pathod[dev] -if %errorlevel% neq 0 exit /b %errorlevel% -pip install -e ./mitmproxy[dev,examples,contentviews] +pip install -r requirements.txt if %errorlevel% neq 0 exit /b %errorlevel% echo. diff --git a/dev.sh b/dev.sh index 2e29c8e19..dfb31a55f 100644 --- a/dev.sh +++ b/dev.sh @@ -4,9 +4,7 @@ VENV=./venv python -m virtualenv $VENV --always-copy . $VENV/bin/activate -pip install -e ./netlib[dev] -pip install -e ./pathod[dev] -pip install -e ./mitmproxy[dev,examples,contentviews] +pip install -r requirements.txt echo "" echo "* Created virtualenv environment in $VENV." diff --git a/mitmproxy/setup.py b/mitmproxy/setup.py index 52c7e6be7..5bce0c5a4 100644 --- a/mitmproxy/setup.py +++ b/mitmproxy/setup.py @@ -1,13 +1,16 @@ from setuptools import setup, find_packages from codecs import open import os -from libmproxy import version +import sys # Based on https://github.com/pypa/sampleproject/blob/master/setup.py # and https://python-packaging-user-guide.readthedocs.org/ here = os.path.abspath(os.path.dirname(__file__)) +sys.path.append(os.path.join(here, "..", "netlib")) +from libmproxy import version + with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() diff --git a/pathod/setup.py b/pathod/setup.py index ff50bdd00..3972d8ffc 100644 --- a/pathod/setup.py +++ b/pathod/setup.py @@ -1,13 +1,16 @@ from setuptools import setup, find_packages from codecs import open import os -from libpathod import version +import sys # Based on https://github.com/pypa/sampleproject/blob/master/setup.py # and https://python-packaging-user-guide.readthedocs.org/ here = os.path.abspath(os.path.dirname(__file__)) +sys.path.append(os.path.join(here, "..", "netlib")) +from libpathod import version + with open(os.path.join(here, 'README.txt'), encoding='utf-8') as f: long_description = f.read() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..e8b49f2fe --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +-e ./netlib[dev] +-e ./pathod[dev] +-e ./mitmproxy[dev,examples,contentviews] +-e ./release \ No newline at end of file