From 425c952293485983c09f5e4a2d715cd1efb3ed5f Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 6 Jul 2018 18:31:35 -0400 Subject: [PATCH] added tox --- .gitignore | 1 + .travis.yml | 63 ++++++++++++++++++++++++----------------------------- setup.py | 9 ++++++++ tox.ini | 20 +++++++++++++++++ 4 files changed, 58 insertions(+), 35 deletions(-) create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index e3d0a36f1..8789d33a3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ /docs_build /lbry-venv +.tox/ .idea/ .coverage .DS_Store diff --git a/.travis.yml b/.travis.yml index e95d15dcf..ce3545e2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,42 +1,35 @@ -os: linux -dist: trusty language: python -python: 2.7 +python: + - "2.7" + - "3.6" -branches: - except: - - gh-pages +addons: + apt: + packages: + - libgmp3-dev + - build-essential + - libssl-dev + - libffi-dev + +install: + - pip install tox-travis coverage pylint + - pushd .. && git clone https://github.com/lbryio/electrumx.git --branch packages && popd + - pushd .. && git clone https://github.com/lbryio/orchstr8.git && popd + - pushd .. && git clone https://github.com/lbryio/lbryumx.git && popd + - pushd .. && git clone https://github.com/lbryio/torba.git && popd + +script: + - pylint lbrynet + - tox + - rvm install ruby-2.3.1 + - rvm use 2.3.1 && gem install danger --version '~> 4.0' && danger + +after_success: + - coverage combine tests/ + - bash <(curl -s https://codecov.io/bash) cache: directories: - $HOME/.cache/pip - $HOME/Library/Caches/pip - - $TRAVIS_BUILD_DIR/cache/wheel - -addons: - #srcclr: - # debug: true - apt: - packages: - - libgmp3-dev - - build-essential - - git - - libssl-dev - - libffi-dev - -before_install: - - virtualenv venv - - source venv/bin/activate - -install: - - pip install -U pip==9.0.3 - - pip install -r requirements.txt - - pip install -r requirements_testing.txt - - pip install . - -script: - - pip install mock pylint - - pylint lbrynet - - PYTHONPATH=. trial lbrynet.tests - - rvm install ruby-2.3.1 - - rvm use 2.3.1 && gem install danger --version '~> 4.0' && danger + - $TRAVIS_BUILD_DIR/.tox diff --git a/setup.py b/setup.py index 526a31902..4c81d16c9 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,9 @@ requires = [ 'base58', 'envparse', 'jsonrpc', + 'cryptography==2.2.2', 'lbryschema==0.0.16', + 'torba', 'miniupnpc', 'txupnp==0.0.1a11', 'pyyaml', @@ -30,6 +32,7 @@ requires = [ 'zope.interface', 'treq', 'docopt', + 'colorama==0.3.7', 'six', ] @@ -66,4 +69,10 @@ setup( install_requires=requires, entry_points={'console_scripts': console_scripts}, zip_safe=False, + extras_require={ + 'test': ( + 'mock>=2.0,<3.0', + 'faker>=0.8,<1.0' + ) + } ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..438aae8ae --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +envlist = py27-unit,py36-integration + +[testenv] +deps = + coverage + ../torba + ../lbryschema + integration: ../electrumx + integration: ../orchstr8 + integration: ../lbryumx +extras = test +changedir = {toxinidir}/tests +setenv = + HOME=/tmp + integration: LEDGER=lbrynet.wallet +commands = + unit: coverage run -p --source={envsitepackagesdir}/lbrynet -m twisted.trial functional unit + integration: orchstr8 download + integration: coverage run -p --source={envsitepackagesdir}/lbrynet -m twisted.trial --reactor=asyncio integration.wallet.test_transactions