xolox/python-executor

Python 3.7 reserved word: async

e4r7hbug opened this issue · 3 comments

https://docs.python.org/3.7/reference/lexical_analysis.html?highlight=reserved%20word#keywords

I didn't see any other issues mentioning this Python 3.7 change. Something to be aware of, async will be reserved in Python 3.7.

[I] (xolox.python-executor-cz6TGcXB)  xolox.python-executor-cz6TGcXB~/g/xolox.python-executor  mastertox -e py37
GLOB sdist-make: /home/ntangsurat/git/xolox.python-executor/setup.py
py37 create: /home/ntangsurat/git/xolox.python-executor/.tox/py37
py37 installdeps: -rrequirements-tests.txt
py37 inst: /home/ntangsurat/git/xolox.python-executor/.tox/dist/executor-19.0.zip
py37 installed: -f ~/.pypi/,coloredlogs==9.0,coverage==4.5.1,executor==19.0,fasteners==0.14.1,humanfriendly==4.8,mock==2.0.0,monotonic==1.4,pbr==3.1.1,property-manager==2.2,py==1.5.2,pytest==3.2.5,pytest-cov==2.5.1,six==1.11.0,verboselogs==1.7,virtualenv==15.1.0
py37 runtests: PYTHONHASHSEED='3646219831'
py37 runtests: commands[0] | py.test
================================================================================ test session starts ================================================================================
platform linux -- Python 3.7.0b2, pytest-3.2.5, py-1.5.2, pluggy-0.4.0 -- /home/ntangsurat/git/xolox.python-executor/.tox/py37/bin/python3.7
cachedir: .cache
rootdir: /home/ntangsurat/git/xolox.python-executor, inifile: tox.ini
plugins: cov-2.5.1
collected 0 items / 1 errors                                                                                                                                                         

====================================================================================== ERRORS =======================================================================================
________________________________________________________________________ ERROR collecting executor/tests.py _________________________________________________________________________
.tox/py37/lib/python3.7/site-packages/_pytest/python.py:395: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
.tox/py37/lib/python3.7/site-packages/py/_path/local.py:668: in pyimport
    __import__(modname)
E     File "/home/ntangsurat/git/xolox.python-executor/executor/__init__.py", line 199
E       if command.async:
E                      ^
E   SyntaxError: invalid syntax
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================== 1 error in 0.16 seconds ==============================================================================
ERROR: InvocationError: '/home/ntangsurat/git/xolox.python-executor/.tox/py37/bin/py.test'
______________________________________________________________________________________ summary ______________________________________________________________________________________
ERROR:   py37: commands failed

PR #11 contains a fix for this issue.

There are in fact two PRs implementing a fix. The other is #13.

@xolox Is there anything I could do to help get one of these merged? I'd be happy to make a detailed review if you'd like!

Added: As a short-term workaround, I've published the solution from #11 to https://pypi.org/project/metabolexecutor/ (repo at https://github.com/metabolize/python-executor).

xolox commented

Thanks for the feedback everyone, this is fixed in executor 21.0 which has just been released. I've decided to rename async to asynchronous (as suggested in #13) and add an alias from the old name to the new name in order to preserve backwards compatibility with existing callers.