diff --git a/.gitignore b/.gitignore index 1a311cdf2..bf3e871c9 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ deluge.pot .build_data* osx/app RELEASE-VERSION -.venv +.venv* diff --git a/.travis.yml b/.travis.yml index d0b77bfaa..677b78950 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,8 @@ addons: packages: # Need Py 3.6 specifically for pre-commit to run black formatter. - python3.6 + # To provide ensurepip module. + - python3-venv # command to install dependencies install: @@ -32,19 +34,27 @@ install: env: global: - - APTPACKAGES="python-libtorrent" + - APTPACKAGES="python-libtorrent python3-libtorrent" - APTPACKAGES_GTKUI="python-glade2" - DISPLAY=:99.0 matrix: include: - - env: TOX_ENV=pydef + - name: Unit tests + env: TOX_ENV=pydef - if: commit_message =~ SECURITY_TEST env: TOX_ENV=security - - env: TOX_ENV=lint - - env: TOX_ENV=docs - - env: TOX_ENV=pygtkui APTPACKAGES="$APTPACKAGES $APTPACKAGES_GTKUI" - - env: TOX_ENV=plugins + - name: Code linting + env: TOX_ENV=lint + - name: Docs build + env: TOX_ENV=docs + - name: PyGTK unit tests only + env: TOX_ENV=pygtkui APTPACKAGES="$APTPACKAGES $APTPACKAGES_GTKUI" + - name: Plugins unit tests + env: TOX_ENV=plugins + - name: Python 3 unit tests + python: 3.5 + env: TOX_ENV=py3 virtualenv: system_site_packages: true @@ -52,7 +62,7 @@ virtualenv: # We use xvfb for the GTKUI tests before_script: - export PYTHONPATH=$PYTHONPATH:$PWD - - python -c "import libtorrent as lt; print lt.__version__" + - python -c "import libtorrent as lt; print(lt.__version__)" - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16" - echo '2.0.0.dev0' > RELEASE-VERSION diff --git a/requirements.txt b/requirements.txt index fcc1b46d3..63923565a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,4 @@ setproctitle pywin32; sys.platform == 'win32' py2-ipaddress; sys.platform == 'win32' certifi; sys.platform == 'win32' -zope-interface +zope.interface diff --git a/tox.ini b/tox.ini index 25b09b15c..f60321311 100644 --- a/tox.ini +++ b/tox.ini @@ -8,10 +8,14 @@ envlist = py27, lint, docs minversion=2.0 [base] -deps = -rrequirements.txt +deps = +# Minimum pip version and setuptools to fix issue running on travis. + pip>=10 + setuptools + -rrequirements.txt [testenv] -install_command = pip install --ignore-installed {opts} {packages} +install_command = {envpython} -m pip install --ignore-installed {opts} {packages} passenv = DISPLAY PYTHONPATH setenv = PYTHONPATH = {toxinidir} sitepackages = True @@ -23,7 +27,7 @@ whitelist_externals = pytest [pytest] # Hide logged warnings and errors in test output. log_cli_level = CRITICAL - +addopts = -p no:warnings # ========== # Unit tests @@ -64,8 +68,6 @@ commands = pytest -v --basetemp=_pytest_temp -s deluge/plugins [testenv:py27] -deps = - {[testenv]deps} basepython = python2.7 commands = {[testenv:pydef]commands} @@ -194,7 +196,18 @@ commands = # ======================== # Developement Environment # ======================== -[testenv:devenv] -envdir = .venv +[basedev] usedevelop = True deps = -rrequirements-dev.txt + +[testenv:denv2] +envdir = .venv2 +basepython = python2.7 +usedevelop = {[basedev]usedevelop} +deps = {[basedev]deps} + +[testenv:denv3] +basepython = python3 +envdir = .venv3 +usedevelop = {[basedev]usedevelop} +deps = {[basedev]deps}