Update tox and CI for Python 3

This commit is contained in:
Calum Lind 2018-10-08 16:05:40 +01:00
parent a980f8e959
commit 6fdbf0ba5d
4 changed files with 39 additions and 16 deletions

2
.gitignore vendored
View File

@ -17,4 +17,4 @@ deluge.pot
.build_data*
osx/app
RELEASE-VERSION
.venv
.venv*

View File

@ -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

View File

@ -9,4 +9,4 @@ setproctitle
pywin32; sys.platform == 'win32'
py2-ipaddress; sys.platform == 'win32'
certifi; sys.platform == 'win32'
zope-interface
zope.interface

27
tox.ini
View File

@ -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}