From 2e0eac09c4212ae6a25b2e02d7e14ee203fdd4eb Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 12 May 2015 12:13:00 -0700 Subject: [PATCH] Remove customized pyX.Y tox requirements Instead of having custom pyX.Y that test a specific set of requirements and similar with other tox envs, just enable more test-requirements directly, in a later change we will use environment markers to denote the differences. Also tweaks the jobboard example to bypass/hack a needed eventlet fix into it so that it actually runs without breaking/never finishing. A TODO note has been left to eventually (someday?) remove this hack when it is no longer needed. Part of fix for bug 1445827 Change-Id: I0fb669f0bdfbe4fe81d89234173f2c3ac4d06de6 --- .../jobboard_produce_consume_colors.py | 9 +++++++++ test-requirements.txt | 14 +++++--------- tox.ini | 18 ------------------ 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/taskflow/examples/jobboard_produce_consume_colors.py b/taskflow/examples/jobboard_produce_consume_colors.py index 6f5860302..54983c474 100644 --- a/taskflow/examples/jobboard_produce_consume_colors.py +++ b/taskflow/examples/jobboard_produce_consume_colors.py @@ -30,6 +30,7 @@ top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) sys.path.insert(0, top_dir) +import six from six.moves import range as compat_range from zake import fake_client @@ -150,6 +151,14 @@ def producer(ident, client): def main(): + if six.PY3: + # TODO(harlowja): Hack to make eventlet work right, remove when the + # following is fixed: https://github.com/eventlet/eventlet/issues/230 + from taskflow.utils import eventlet_utils as _eu # noqa + try: + import eventlet as _eventlet # noqa + except ImportError: + pass with contextlib.closing(fake_client.FakeClient()) as c: created = [] for i in compat_range(0, PRODUCERS): diff --git a/test-requirements.txt b/test-requirements.txt index d4d99f685..d2b601c6b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -16,17 +16,13 @@ zake>=0.1.6 # Apache-2.0 kazoo>=1.3.1,!=2.1 # Used for testing database persistence backends. -# -# NOTE(harlowja): SQLAlchemy isn't listed here currently but is -# listed in our tox.ini files so that we can test multiple varying SQLAlchemy -# versions to ensure a wider range of compatibility. -# -# Explict mysql drivers are also not listed here so that we can test against -# PyMySQL or MySQL-python depending on the python version the tests are being -# ran in (MySQL-python is currently preferred for 2.x environments, since -# it has been used in openstack for the longest). +SQLAlchemy>=0.9.7,<=0.9.99 alembic>=0.7.2 psycopg2 +PyMySQL>=0.6.2 + +# Used for making sure we still work with eventlet. +eventlet>=0.17.3 # Docs build jobs need these packages. sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 diff --git a/tox.ini b/tox.ini index 3581facc8..535e611fe 100644 --- a/tox.ini +++ b/tox.ini @@ -62,28 +62,10 @@ import_exceptions = six.moves taskflow.test.mock unittest.mock -# NOTE(imelnikov): pyXY envs are considered to be default, so they must have -# richest set of test requirements -[testenv:py26] -basepython = python2.6 -deps = {[testenv]deps} - MySQL-python - eventlet>=0.15.1 - SQLAlchemy>=0.7.8,<=0.8.99 - [testenv:py27] deps = {[testenv]deps} - MySQL-python - eventlet>=0.15.1 - SQLAlchemy>=0.7.8,<=0.9.99 doc8 commands = python setup.py testr --slowest --testr-args='{posargs}' sphinx-build -b doctest doc/source doc/build doc8 doc/source - -[testenv:py34] -deps = {[testenv]deps} - SQLAlchemy>=0.7.8,<=0.9.99 - PyMySQL>=0.6.2 -