[Python-modules-team] Bug#997480: python-click-threading: FTBFS: dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.9 returned exit code 13
Lucas Nussbaum
lucas at debian.org
Sat Oct 23 21:40:28 BST 2021
Source: python-click-threading
Version: 0.4.4-2
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lucas at debian.org
Usertags: ftbfs-20211023 ftbfs-bookworm
Hi,
During a rebuild of all packages in sid, your package failed to build
on amd64.
Relevant part (hopefully):
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> LC_ALL=C.UTF-8 dh_auto_test
> dh_auto_test: warning: Compatibility levels before 10 are deprecated (level 9 in use)
> I: pybuild base:232: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_click-threading/build; python3.9 -m pytest tests
> ============================= test session starts ==============================
> platform linux -- Python 3.9.7, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
> rootdir: /<<PKGBUILDDIR>>, configfile: setup.cfg
> collected 3 items
>
> tests/test_basic.py .FF [100%]
>
> =================================== FAILURES ===================================
> _____________________________ test_ui_worker_basic _____________________________
>
> runner = <click.testing.CliRunner object at 0x7fa3914a74c0>
>
> def test_ui_worker_basic(runner):
> @click.command()
> def cli():
>
> ui = click_threading.UiWorker()
>
> def target():
> click.prompt('two')
> ui.shutdown()
>
> click.prompt('one')
>
> with ui.patch_click():
> t = click_threading.Thread(target=target)
> t.start()
> ui.run()
>
> click.prompt('three')
> t.join()
>
> > result = runner.invoke(cli, catch_exceptions=False, input='y\n' * 3)
>
> tests/test_basic.py:53:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> /usr/lib/python3/dist-packages/click/testing.py:408: in invoke
> return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
> /usr/lib/python3/dist-packages/click/core.py:1051: in main
> rv = self.invoke(ctx)
> /usr/lib/python3/dist-packages/click/core.py:1393: in invoke
> return ctx.invoke(self.callback, **ctx.params)
> /usr/lib/python3/dist-packages/click/core.py:752: in invoke
> return __callback(*args, **kwargs)
> tests/test_basic.py:45: in cli
> with ui.patch_click():
> /usr/lib/python3.9/contextlib.py:119: in __enter__
> return next(self.gen)
> click_threading/__init__.py:144: in patch_click
> with patch_ui_functions(wrapper):
> /usr/lib/python3.9/contextlib.py:119: in __enter__
> return next(self.gen)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> wrapper = <function UiWorker.patch_click.<locals>.wrapper at 0x7fa3915c4160>
>
> @contextlib.contextmanager
> def patch_ui_functions(wrapper):
> '''Wrap all termui functions with a custom decorator.'''
> NONE = object()
> import click
>
> saved = []
>
> for name, info in sorted(_ui_functions.items()):
> f = getattr(click, name, NONE)
> if f is NONE:
> continue
>
> new_f = wrapper(_copy_fn(f), info)
>
> argspec = getargspec(f)
> signature = inspect.formatargspec(*argspec) \
> .lstrip('(') \
> .rstrip(')')
> args = ', '.join(arg.split('=')[0].split(':')[0].strip()
> for arg in signature.split(','))
>
> > stub_f = eval('lambda {s}: {n}._real_click_fn({a})'
> .format(n=f.__name__, s=signature, a=args))
> E File "<string>", line 1
> E lambda ) -> None: clear._real_click_fn() -> None)
> E ^
> E SyntaxError: unmatched ')'
>
> click_threading/monkey.py:50: SyntaxError
> ______________________________ test_monkey_patch _______________________________
>
> capsys = <_pytest.capture.CaptureFixture object at 0x7fa390ac3a90>
>
> def test_monkey_patch(capsys):
> old_echo = click.echo
> if PY2:
> old_code = old_echo.func_code
> else:
> old_code = old_echo.__code__
>
> def wrapper(f, info):
> def new_f(*a, **kw):
> assert old_echo is not f
> if PY2:
> assert f.func_code is old_code
> else:
> assert f.__code__ is old_code
>
> print("LOL")
> rv = f(*a, **kw)
> print("LOL")
> return rv
> return new_f
>
> > with click_threading.monkey.patch_ui_functions(wrapper):
>
> tests/test_basic.py:78:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> /usr/lib/python3.9/contextlib.py:119: in __enter__
> return next(self.gen)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> wrapper = <function test_monkey_patch.<locals>.wrapper at 0x7fa391487af0>
>
> @contextlib.contextmanager
> def patch_ui_functions(wrapper):
> '''Wrap all termui functions with a custom decorator.'''
> NONE = object()
> import click
>
> saved = []
>
> for name, info in sorted(_ui_functions.items()):
> f = getattr(click, name, NONE)
> if f is NONE:
> continue
>
> new_f = wrapper(_copy_fn(f), info)
>
> argspec = getargspec(f)
> signature = inspect.formatargspec(*argspec) \
> .lstrip('(') \
> .rstrip(')')
> args = ', '.join(arg.split('=')[0].split(':')[0].strip()
> for arg in signature.split(','))
>
> > stub_f = eval('lambda {s}: {n}._real_click_fn({a})'
> .format(n=f.__name__, s=signature, a=args))
> E File "<string>", line 1
> E lambda ) -> None: clear._real_click_fn() -> None)
> E ^
> E SyntaxError: unmatched ')'
>
> click_threading/monkey.py:50: SyntaxError
> =============================== warnings summary ===============================
> .pybuild/cpython3_3.9_click-threading/build/tests/test_basic.py::test_ui_worker_basic
> .pybuild/cpython3_3.9_click-threading/build/tests/test_basic.py::test_monkey_patch
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_click-threading/build/click_threading/monkey.py:44: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
> signature = inspect.formatargspec(*argspec) \
>
> -- Docs: https://docs.pytest.org/en/stable/warnings.html
> =========================== short test summary info ============================
> FAILED tests/test_basic.py::test_ui_worker_basic - File "<string>", line 1
> FAILED tests/test_basic.py::test_monkey_patch - File "<string>", line 1
> =================== 2 failed, 1 passed, 2 warnings in 0.13s ====================
> E: pybuild pybuild:354: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_click-threading/build; python3.9 -m pytest tests
> dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.9 returned exit code 13
The full build log is available from:
http://qa-logs.debian.net/2021/10/23/python-click-threading_0.4.4-2_unstable.log
A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects
If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.
More information about the Python-modules-team
mailing list