diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 65b7265a..67d20a27 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -193,8 +193,6 @@ class Fold(object): def __exit__(self, _1, _2, _3): pass -os.environ.setdefault('ANSIBLE_STRATEGY', - os.environ.get('STRATEGY', 'mitogen_linear')) GIT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # Used only when MODE=mitogen DISTRO = os.environ.get('DISTRO', 'debian9') diff --git a/.ci/debops_common_install.py b/.ci/debops_common_install.py index 75124fe3..afafe39a 100755 --- a/.ci/debops_common_install.py +++ b/.ci/debops_common_install.py @@ -7,7 +7,7 @@ ci_lib.DISTROS = ['debian'] ci_lib.run_batches([ [ - 'pip install -qqq "debops[ansible]==2.1.2"', + 'python -m pip --no-python-version-warning --disable-pip-version-check "debops[ansible]==2.1.2"', ], [ 'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws', diff --git a/setup.py b/setup.py index 9d529a36..db9595f7 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ setup( license = 'New BSD', url = 'https://github.com/mitogen-hq/mitogen/', packages = find_packages(exclude=['tests', 'examples']), - python_requires='>=2.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*', zip_safe = False, classifiers = [ 'Environment :: Console', @@ -70,10 +70,6 @@ setup( 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.4', - 'Programming Language :: Python :: 2.5', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', diff --git a/tests/ansible/lib/action/assert_equal.py b/tests/ansible/lib/action/assert_equal.py index 84ec7606..f01e7ae5 100644 --- a/tests/ansible/lib/action/assert_equal.py +++ b/tests/ansible/lib/action/assert_equal.py @@ -11,9 +11,7 @@ import unittest2 import ansible.template -from ansible.errors import AnsibleError from ansible.plugins.action import ActionBase -from ansible.module_utils.six import string_types TEMPLATE_KWARGS = {} diff --git a/tests/ansible/mitogen_ansible_playbook.py b/tests/ansible/mitogen_ansible_playbook.py index 54fd4283..30ed0493 100755 --- a/tests/ansible/mitogen_ansible_playbook.py +++ b/tests/ansible/mitogen_ansible_playbook.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import os -import subprocess import sys os.environ['ANSIBLE_STRATEGY'] = 'mitogen_linear' os.execlp( diff --git a/tests/bench/fork.py b/tests/bench/fork.py index af5cb3a7..d77f4437 100644 --- a/tests/bench/fork.py +++ b/tests/bench/fork.py @@ -5,6 +5,12 @@ Measure latency of .fork() setup/teardown. import mitogen import mitogen.core +try: + xrange +except NameError: + xrange = range + + @mitogen.main() def main(router): t0 = mitogen.core.now() @@ -12,4 +18,4 @@ def main(router): t = mitogen.core.now() ctx = router.fork() ctx.shutdown(wait=True) - print '++', 1000 * ((mitogen.core.now() - t0) / (1.0+x)) + print('++ %d' % 1000 * ((mitogen.core.now() - t0) / (1.0+x))) diff --git a/tests/create_child_test.py b/tests/create_child_test.py index 26f10d57..aae5882d 100644 --- a/tests/create_child_test.py +++ b/tests/create_child_test.py @@ -6,7 +6,6 @@ import sys import time import tempfile -import mock import unittest2 import mitogen.core @@ -80,7 +79,7 @@ def close_proc(proc): proc.stdin.close() proc.stdout.close() if proc.stderr: - prco.stderr.close() + proc.stderr.close() def wait_read(fp, n): diff --git a/tests/data/python_never_responds.py b/tests/data/python_never_responds.py index 449d8565..9caa5a63 100755 --- a/tests/data/python_never_responds.py +++ b/tests/data/python_never_responds.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # I am a Python interpreter that sits idle until the connection times out. import time diff --git a/tests/parent_test.py b/tests/parent_test.py index d6efe998..7c056f36 100644 --- a/tests/parent_test.py +++ b/tests/parent_test.py @@ -2,15 +2,12 @@ import errno import fcntl import os import signal -import subprocess import sys -import tempfile import time import mock import unittest2 import testlib -from testlib import Popen__terminate import mitogen.core import mitogen.parent diff --git a/tests/soak/cpu_load.py b/tests/soak/cpu_load.py index 8890272c..5a86fd0e 100644 --- a/tests/soak/cpu_load.py +++ b/tests/soak/cpu_load.py @@ -25,7 +25,7 @@ def burn(): mul = 1.5 count = int(mul * multiprocessing.cpu_count()) -print count +print(count) procs = [multiprocessing.Process(target=burn) for _ in range(count)] diff --git a/tests/two_three_compat_test.py b/tests/two_three_compat_test.py index f30a233e..e761244c 100644 --- a/tests/two_three_compat_test.py +++ b/tests/two_three_compat_test.py @@ -1,7 +1,3 @@ - -import logging -import time - import unittest2 import mitogen.core diff --git a/tox.ini b/tox.ini index 43e2537e..1a0d29f9 100644 --- a/tox.ini +++ b/tox.ini @@ -56,10 +56,10 @@ basepython = deps = -r{toxinidir}/tests/requirements.txt mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt - ansible2.3: ansible=2.3.3.0 - ansible2.4: ansible=2.4.6.0 - ansible2.8: ansible=2.8.3 - ansible2.9: ansible=2.9.6 + ansible2.3: ansible==2.3.3.0 + ansible2.4: ansible==2.4.6.0 + ansible2.8: ansible==2.8.3 + ansible2.9: ansible==2.9.6 ansible2.10: ansible-base<2.10.14 ansible2.10: ansible==2.10.0 ansible3: ansible-base<2.10.14 @@ -67,7 +67,7 @@ deps = ansible4: ansible==4.8.0 ansible5: ansible==5.0.1 install_command = - python -m pip --no-python-version-warning install {opts} {packages} + python -m pip --no-python-version-warning --disable-pip-version-check install {opts} {packages} commands_pre = mode_ansible: {toxinidir}/.ci/ansible_install.py mode_debops_common: {toxinidir}/.ci/debops_common_install.py @@ -85,6 +85,8 @@ passenv = AWS_SECRET_ACCESS_KEY HOME setenv = + ANSIBLE_SKIP_TAGS = requires_local_sudo,resource_intensive + ANSIBLE_STRATEGY = mitogen_linear NOCOVERAGE_ERASE = 1 NOCOVERAGE_REPORT = 1 # Only applicable to MODE=mitogen @@ -115,7 +117,7 @@ setenv = mode_ansible: MODE=ansible mode_debops_common: MODE=debops_common mode_mitogen: MODE=mitogen - strategy_linear: STRATEGY=linear + strategy_linear: ANSIBLE_STRATEGY=linear whitelist_externals = docker docker-credential-secretservice