[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please help with test suite error and installation problem of python-aws-xray-sdk (Was: If there is no response in debian-python then debian-science might be the right team)



[Andreas Tille, 2018-01-15]
>   1) test suite
> 
> I: pybuild base:184: cd /build/python-aws-xray-sdk-0.95/.pybuild/pythonX.Y_2.7/build; python2.7 -m pytest tests
> ============================= test session starts ==============================
> platform linux2 -- Python 2.7.14+, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
> rootdir: /build/python-aws-xray-sdk-0.95, inifile:
> collected 57 items / 4 errors
> 
> ==================================== ERRORS ====================================
>  ERROR collecting .pybuild/pythonX.Y_2.7/build/tests/test_async_local_storage.py.
> /usr/lib/python2.7/dist-packages/_pytest/python.py:395: in _importtestmodule
>     mod = self.fspath.pyimport(ensuresyspath=importmode)
> /usr/lib/python2.7/dist-packages/py/_path/local.py:662: in pyimport
>     __import__(modname)
> E     File "/build/python-aws-xray-sdk-0.95/.pybuild/pythonX.Y_2.7/build/tests/test_async_local_storage.py", line 10
> E       async def _test():
> E               ^
> E   SyntaxError: invalid syntax

async (and all aio* libs in other tests) is not available in Python 2.7
so simply disable them. You can do this in debian/rules:

export PYBUILD_TEST_ARGS_python2=--ignore tests/test_async_local_storage.py --ignore tests/test_async_recorder.py --ignore tests/ext/aiobotocore/ --ignore tests/ext/aiohttp/


>   2) installation of the resulting package:
> 
> E:Sub-process /usr/bin/dpkg returned an error code (1)
> Traceback (most recent call last):
>   File "/usr/share/wajig/debfile-deps.py", line 56, in <module>
>     main(sys.argv[1])
>   File "/usr/share/wajig/debfile-deps.py", line 48, in main
>     cache.commit(apt.progress.text.AcquireProgress())
>   File "/usr/lib/python3/dist-packages/apt/cache.py", line 529, in commit
>     raise SystemError("installArchives() failed")
> SystemError: installArchives() failed
> python-aws-xray-sdk (0.95-1) wird eingerichtet ...
>   File "/usr/lib/python2.7/dist-packages/aws_xray_sdk/core/async_context.py", line 14
>     def __init__(self, *args, loop=None, use_task_factory=True, **kwargs):
>                                  ^
> SyntaxError: invalid syntax
> 
>   File "/usr/lib/python2.7/dist-packages/aws_xray_sdk/core/async_recorder.py", line 20
>     async def wrapper(wrapped, instance, args, kwargs):
>         ^
> SyntaxError: invalid syntax
> 
>   File "/usr/lib/python2.7/dist-packages/aws_xray_sdk/ext/aiobotocore/patch.py", line 30
>     async def _xray_traced_aiobotocore(wrapped, instance, args, kwargs):
>             ^
> SyntaxError: invalid syntax
> 
>   File "/usr/lib/python2.7/dist-packages/aws_xray_sdk/ext/aiohttp/middleware.py", line 11
>     async def middleware(app, handler):
>             ^
> SyntaxError: invalid syntax

similar issue here, async stuff will not work in 2.7, you can tell
dh_python2 to remove these files by adding
debian/python-aws-xray-sdk.pyremove file containing:

  aws_xray_sdk/core/async_*
  aws_xray_sdk/ext/aiobotocore/
  aws_xray_sdk/ext/aiohttp/

-- 
GPG: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: