Skip to content

Commit

Permalink
set default python to python3
Browse files Browse the repository at this point in the history
Set the default python to python3 except for the py27 environment. We
have to set that explicitly to override the new default.

Have py27 and py3* jobs run same commands by removing the commands entry
for py27.

The pep8 rules under python 3 are different, so we need to fix a
couple of issues with blank space. The E721 rule is ignored entirely
because we are not yet using a version of flake8 that supports
ignoring individual rules on specific lines, although the instructions
for that are added so that when we upgrade flake8 to a newer version
we can remove the global rule.

Change-Id: Id236b0632a83a188958130d04f1e9c476c5ace65
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
  • Loading branch information
dhellmann committed Apr 17, 2018
1 parent 7c1f4c2 commit f4948ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion taskflow/conductors/backends/impl_executor.py
Expand Up @@ -180,7 +180,7 @@ def _run_engine():
(engine.prepare, 'preparation'),
(engine.validate, 'validation'),
(_run_engine, 'running')]:
self._notifier.notify("%s_start" % event_name, details)
self._notifier.notify("%s_start" % event_name, details)
stage_func()
self._notifier.notify("%s_end" % event_name, details)
except excp.WrappedFailure as e:
Expand Down
2 changes: 1 addition & 1 deletion taskflow/engines/worker_based/engine.py
Expand Up @@ -82,4 +82,4 @@ def _fetch_task_executor(cls, options, flow_detail):
pr.REQUEST_TIMEOUT),
worker_expiry=options.get('worker_expiry',
pr.EXPIRES_AFTER),
)
)
5 changes: 4 additions & 1 deletion taskflow/types/failure.py
Expand Up @@ -54,7 +54,10 @@ def _are_equal_exc_info_tuples(ei1, ei2):
# copy_exc_info above.
if ei1[0] is not ei2[0]:
return False
if not all((type(ei1[1]) == type(ei2[1]),
# NOTE(dhellmann): The flake8/pep8 error E721 does not apply here
# because we want the types to be exactly the same, not just have
# one be inherited from the other.
if not all((type(ei1[1]) == type(ei2[1]), # noqa: E721
_exception_message(ei1[1]) == _exception_message(ei2[1]),
repr(ei1[1]) == repr(ei2[1]))):
return False
Expand Down
10 changes: 3 additions & 7 deletions tox.ini
Expand Up @@ -10,6 +10,7 @@ envlist = cover,
update-states

[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
BRANCH_NAME=master
CLIENT_NAME=taskflow
Expand Down Expand Up @@ -50,6 +51,7 @@ commands = {posargs}
[flake8]
builtins = _
exclude = .venv,.tox,dist,doc,*egg,.git,build,tools
ignore = E721

[hacking]
import_exceptions = six.moves
Expand All @@ -64,19 +66,13 @@ import_exceptions = six.moves
ignore-path = doc/*/target,doc/*/build*

[testenv:py27]
deps = .[test,workers,zookeeper,database,redis,eventlet]
-r{toxinidir}/doc/requirements.txt
commands =
python setup.py testr --slowest --testr-args='{posargs}'
sphinx-build -b doctest doc/source doc/build
doc8 --ignore-path "doc/source/history.rst" doc/source
basepython = python2.7

[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:lower-constraints]
basepython = python3
install_command = pip install {opts} {packages}
deps =
-c{toxinidir}/lower-constraints.txt
Expand Down

0 comments on commit f4948ae

Please sign in to comment.