diff --git a/tox.ini b/tox.ini
index 085f438989..920211bf50 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,8 +3,7 @@ envlist = packaging, py27, py36, pep8, check_isort
[base]
deps =
- coverage
- Twisted>=15.1
+ Twisted>=17.1
mock
python-subunit
junitxml
@@ -12,6 +11,20 @@ deps =
# needed by some of the tests
lxml
+ # cyptography 2.2 requires setuptools >= 18.5
+ #
+ # older versions of virtualenv (?) give us a virtualenv with the same
+ # version of setuptools as is installed on the system python (and tox runs
+ # virtualenv under python3, so we get the version of setuptools that is
+ # installed on that).
+ #
+ # anyway, make sure that we have a recent enough setuptools.
+ setuptools>=18.5
+
+ # we also need a semi-recent version of pip, because old ones fail to
+ # install the "enum34" dependency of cryptography.
+ pip>=10
+
setenv =
PYTHONDONTWRITEBYTECODE = no_byte_code
@@ -26,9 +39,7 @@ passenv = *
commands =
/usr/bin/find "{toxinidir}" -name '*.pyc' -delete
- coverage run {env:COVERAGE_OPTS:} --source="{toxinidir}/synapse" \
- "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
- {env:DUMP_COVERAGE_COMMAND:coverage report -m}
+ "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
[testenv:py27]
@@ -64,49 +75,41 @@ setenv =
{[base]setenv}
SYNAPSE_POSTGRES = 1
-[testenv:py36]
-usedevelop=true
+# A test suite for the oldest supported versions of Python libraries, to catch
+# any uses of APIs not available in them.
+[testenv:py27-old]
+skip_install=True
+deps =
+ # Old automat version for Twisted
+ Automat == 0.3.0
+
+ mock
+ lxml
commands =
/usr/bin/find "{toxinidir}" -name '*.pyc' -delete
- coverage run {env:COVERAGE_OPTS:} --source="{toxinidir}/synapse" \
- "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests/config \
- tests/api/test_filtering.py \
- tests/api/test_ratelimiting.py \
- tests/appservice \
- tests/crypto \
- tests/events \
- tests/handlers/test_appservice.py \
- tests/handlers/test_auth.py \
- tests/handlers/test_device.py \
- tests/handlers/test_directory.py \
- tests/handlers/test_e2e_keys.py \
- tests/handlers/test_presence.py \
- tests/handlers/test_profile.py \
- tests/handlers/test_register.py \
- tests/replication/slave/storage/test_account_data.py \
- tests/replication/slave/storage/test_receipts.py \
- tests/storage/test_appservice.py \
- tests/storage/test_background_update.py \
- tests/storage/test_base.py \
- tests/storage/test__base.py \
- tests/storage/test_client_ips.py \
- tests/storage/test_devices.py \
- tests/storage/test_end_to_end_keys.py \
- tests/storage/test_event_push_actions.py \
- tests/storage/test_keys.py \
- tests/storage/test_presence.py \
- tests/storage/test_profile.py \
- tests/storage/test_registration.py \
- tests/storage/test_room.py \
- tests/storage/test_user_directory.py \
- tests/test_distributor.py \
- tests/test_dns.py \
- tests/test_preview.py \
- tests/test_test_utils.py \
- tests/test_types.py \
- tests/util} \
- {env:TOXSUFFIX:}
- {env:DUMP_COVERAGE_COMMAND:coverage report -m}
+ # Make all greater-thans equals so we test the oldest version of our direct
+ # dependencies, but make the pyopenssl 17.0, which can work against an
+ # OpenSSL 1.1 compiled cryptography (as older ones don't compile on Travis).
+ /bin/sh -c 'python -m synapse.python_dependencies | sed -e "s/>=/==/g" -e "s/psycopg2==2.6//" -e "s/pyopenssl==16.0.0/pyopenssl==17.0.0/" | xargs pip install'
+ # Install Synapse itself. This won't update any libraries.
+ pip install -e .
+ {envbindir}/trial {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
+
+[testenv:py35]
+usedevelop=true
+
+[testenv:py36]
+usedevelop=true
+
+[testenv:py36-postgres]
+usedevelop=true
+deps =
+ {[base]deps}
+ psycopg2
+setenv =
+ {[base]setenv}
+ SYNAPSE_POSTGRES = 1
+
[testenv:packaging]
deps =
@@ -116,10 +119,10 @@ commands =
[testenv:pep8]
skip_install = True
-basepython = python2.7
+basepython = python3.6
deps =
flake8
-commands = /bin/sh -c "flake8 synapse tests {env:PEP8SUFFIX:}"
+commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}"
[testenv:check_isort]
skip_install = True
|