Bug 1899842 - xonsh fails to build with Python 3.10: TypeError: "('ast', 'eval')" not a recognized macro type.
Summary: xonsh fails to build with Python 3.10: TypeError: "('ast', 'eval')" not a rec...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: xonsh
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carmen Bianca Bakker
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-20 08:17 UTC by Tomáš Hrnčiar
Modified: 2021-02-09 16:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-11-20 08:17:29 UTC
xonsh fails to build with Python 3.10.0a2.

=================================== FAILURES ===================================
[31m[1m________________________ test_call_macro_ast_eval_expr _________________________[0m

    [94mdef[39;49;00m [92mtest_call_macro_ast_eval_expr[39;49;00m():
        [94mdef[39;49;00m [92mf[39;49;00m(x: ([33m"[39;49;00m[33mast[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33meval[39;49;00m[33m"[39;49;00m)):
            [94mreturn[39;49;00m x
    
>       rtn = call_macro(f, [[33m"[39;49;00m[33mx == 5[39;49;00m[33m"[39;49;00m], {}, [94mNone[39;49;00m)

[1m[31m/builddir/build/BUILD/xonsh-0.9.21/tests/test_builtins.py[0m:333: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1220: in call_macro
    arg = convert_macro_arg(
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1129: in convert_macro_arg
    kind = _convert_kind_flag(kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = "('ast', 'eval')"

    [94mdef[39;49;00m [92m_convert_kind_flag[39;49;00m(x):
        [33m"""Puts a kind flag (string) a canonical form."""[39;49;00m
        x = x.lower()
        kind = MACRO_FLAG_KINDS.get(x, [94mNone[39;49;00m)
        [94mif[39;49;00m kind [95mis[39;49;00m [94mNone[39;49;00m:
>           [94mraise[39;49;00m [96mTypeError[39;49;00m([33m"[39;49;00m[33m{0!r}[39;49;00m[33m not a recognized macro type.[39;49;00m[33m"[39;49;00m.format(x))
[1m[31mE           TypeError: "('ast', 'eval')" not a recognized macro type.[0m

[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1097: TypeError
[31m[1m_______________________ test_call_macro_ast_single_expr ________________________[0m

    [94mdef[39;49;00m [92mtest_call_macro_ast_single_expr[39;49;00m():
        [94mdef[39;49;00m [92mf[39;49;00m(x: ([33m"[39;49;00m[33mast[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33msingle[39;49;00m[33m"[39;49;00m)):
            [94mreturn[39;49;00m x
    
>       rtn = call_macro(f, [[33m"[39;49;00m[33mx == 5[39;49;00m[33m"[39;49;00m], {}, [94mNone[39;49;00m)

[1m[31m/builddir/build/BUILD/xonsh-0.9.21/tests/test_builtins.py[0m:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1220: in call_macro
    arg = convert_macro_arg(
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1129: in convert_macro_arg
    kind = _convert_kind_flag(kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = "('ast', 'single')"

    [94mdef[39;49;00m [92m_convert_kind_flag[39;49;00m(x):
        [33m"""Puts a kind flag (string) a canonical form."""[39;49;00m
        x = x.lower()
        kind = MACRO_FLAG_KINDS.get(x, [94mNone[39;49;00m)
        [94mif[39;49;00m kind [95mis[39;49;00m [94mNone[39;49;00m:
>           [94mraise[39;49;00m [96mTypeError[39;49;00m([33m"[39;49;00m[33m{0!r}[39;49;00m[33m not a recognized macro type.[39;49;00m[33m"[39;49;00m.format(x))
[1m[31mE           TypeError: "('ast', 'single')" not a recognized macro type.[0m

[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1097: TypeError
[31m[1m________________________ test_call_macro_ast_exec_expr _________________________[0m

    [94mdef[39;49;00m [92mtest_call_macro_ast_exec_expr[39;49;00m():
        [94mdef[39;49;00m [92mf[39;49;00m(x: ([33m"[39;49;00m[33mast[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexec[39;49;00m[33m"[39;49;00m)):
            [94mreturn[39;49;00m x
    
>       rtn = call_macro(f, [[33m"[39;49;00m[33mx == 5[39;49;00m[33m"[39;49;00m], {}, [94mNone[39;49;00m)

[1m[31m/builddir/build/BUILD/xonsh-0.9.21/tests/test_builtins.py[0m:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1220: in call_macro
    arg = convert_macro_arg(
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1129: in convert_macro_arg
    kind = _convert_kind_flag(kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = "('ast', 'exec')"

    [94mdef[39;49;00m [92m_convert_kind_flag[39;49;00m(x):
        [33m"""Puts a kind flag (string) a canonical form."""[39;49;00m
        x = x.lower()
        kind = MACRO_FLAG_KINDS.get(x, [94mNone[39;49;00m)
        [94mif[39;49;00m kind [95mis[39;49;00m [94mNone[39;49;00m:
>           [94mraise[39;49;00m [96mTypeError[39;49;00m([33m"[39;49;00m[33m{0!r}[39;49;00m[33m not a recognized macro type.[39;49;00m[33m"[39;49;00m.format(x))
[1m[31mE           TypeError: "('ast', 'exec')" not a recognized macro type.[0m

[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1097: TypeError
[31m[1m______________________ test_call_macro_ast_eval_statement ______________________[0m

    [94mdef[39;49;00m [92mtest_call_macro_ast_eval_statement[39;49;00m():
        [94mdef[39;49;00m [92mf[39;49;00m(x: ([33m"[39;49;00m[33mast[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33meval[39;49;00m[33m"[39;49;00m)):
            [94mreturn[39;49;00m x
    
        [94mtry[39;49;00m:
>           call_macro(f, [[33m"[39;49;00m[33mx = 5[39;49;00m[33m"[39;49;00m], {}, [94mNone[39;49;00m)

[1m[31m/builddir/build/BUILD/xonsh-0.9.21/tests/test_builtins.py[0m:358: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1220: in call_macro
    arg = convert_macro_arg(
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1129: in convert_macro_arg
    kind = _convert_kind_flag(kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = "('ast', 'eval')"

    [94mdef[39;49;00m [92m_convert_kind_flag[39;49;00m(x):
        [33m"""Puts a kind flag (string) a canonical form."""[39;49;00m
        x = x.lower()
        kind = MACRO_FLAG_KINDS.get(x, [94mNone[39;49;00m)
        [94mif[39;49;00m kind [95mis[39;49;00m [94mNone[39;49;00m:
>           [94mraise[39;49;00m [96mTypeError[39;49;00m([33m"[39;49;00m[33m{0!r}[39;49;00m[33m not a recognized macro type.[39;49;00m[33m"[39;49;00m.format(x))
[1m[31mE           TypeError: "('ast', 'eval')" not a recognized macro type.[0m

[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1097: TypeError
[31m[1m_____________________ test_call_macro_ast_single_statement _____________________[0m

    [94mdef[39;49;00m [92mtest_call_macro_ast_single_statement[39;49;00m():
        [94mdef[39;49;00m [92mf[39;49;00m(x: ([33m"[39;49;00m[33mast[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33msingle[39;49;00m[33m"[39;49;00m)):
            [94mreturn[39;49;00m x
    
>       rtn = call_macro(f, [[33m"[39;49;00m[33mx = 5[39;49;00m[33m"[39;49;00m], {}, [94mNone[39;49;00m)

[1m[31m/builddir/build/BUILD/xonsh-0.9.21/tests/test_builtins.py[0m:372: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1220: in call_macro
    arg = convert_macro_arg(
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1129: in convert_macro_arg
    kind = _convert_kind_flag(kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = "('ast', 'single')"

    [94mdef[39;49;00m [92m_convert_kind_flag[39;49;00m(x):
        [33m"""Puts a kind flag (string) a canonical form."""[39;49;00m
        x = x.lower()
        kind = MACRO_FLAG_KINDS.get(x, [94mNone[39;49;00m)
        [94mif[39;49;00m kind [95mis[39;49;00m [94mNone[39;49;00m:
>           [94mraise[39;49;00m [96mTypeError[39;49;00m([33m"[39;49;00m[33m{0!r}[39;49;00m[33m not a recognized macro type.[39;49;00m[33m"[39;49;00m.format(x))
[1m[31mE           TypeError: "('ast', 'single')" not a recognized macro type.[0m

[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1097: TypeError
[31m[1m______________________ test_call_macro_ast_exec_statement ______________________[0m

    [94mdef[39;49;00m [92mtest_call_macro_ast_exec_statement[39;49;00m():
        [94mdef[39;49;00m [92mf[39;49;00m(x: ([33m"[39;49;00m[33mast[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mexec[39;49;00m[33m"[39;49;00m)):
            [94mreturn[39;49;00m x
    
>       rtn = call_macro(f, [[33m"[39;49;00m[33mx = 5[39;49;00m[33m"[39;49;00m], {}, [94mNone[39;49;00m)

[1m[31m/builddir/build/BUILD/xonsh-0.9.21/tests/test_builtins.py[0m:380: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1220: in call_macro
    arg = convert_macro_arg(
[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1129: in convert_macro_arg
    kind = _convert_kind_flag(kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = "('ast', 'exec')"

    [94mdef[39;49;00m [92m_convert_kind_flag[39;49;00m(x):
        [33m"""Puts a kind flag (string) a canonical form."""[39;49;00m
        x = x.lower()
        kind = MACRO_FLAG_KINDS.get(x, [94mNone[39;49;00m)
        [94mif[39;49;00m kind [95mis[39;49;00m [94mNone[39;49;00m:
>           [94mraise[39;49;00m [96mTypeError[39;49;00m([33m"[39;49;00m[33m{0!r}[39;49;00m[33m not a recognized macro type.[39;49;00m[33m"[39;49;00m.format(x))
[1m[31mE           TypeError: "('ast', 'exec')" not a recognized macro type.[0m

[1m[31m/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py[0m:1097: TypeError
=========================== short test summary info ============================
FAILED tests/test_builtins.py::test_call_macro_ast_eval_expr - TypeError: "('...
FAILED tests/test_builtins.py::test_call_macro_ast_single_expr - TypeError: "...
FAILED tests/test_builtins.py::test_call_macro_ast_exec_expr - TypeError: "('...
FAILED tests/test_builtins.py::test_call_macro_ast_eval_statement - TypeError...
FAILED tests/test_builtins.py::test_call_macro_ast_single_statement - TypeErr...
FAILED tests/test_builtins.py::test_call_macro_ast_exec_statement - TypeError...
[31m====== [31m[1m6 failed[0m, [32m1982 passed[0m, [33m16 skipped[0m, [33m1 xpassed[0m[31m in 113.48s (0:01:53)[0m[31m =======[0m
Traceback (most recent call last):
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/bin/xonsh", line 33, in <module>
    sys.exit(load_entry_point('xonsh==0.9.21', 'console_scripts', 'xonsh')())
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/main.py", line 426, in main
    _failback_to_other_shells(args, err)
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/main.py", line 373, in _failback_to_other_shells
    raise err
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/main.py", line 424, in main
    sys.exit(main_xonsh(args))
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/main.py", line 471, in main_xonsh
    run_script_with_cache(
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/codecache.py", line 162, in run_script_with_cache
    run_compiled_code(ccode, glb, loc, mode)
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/codecache.py", line 67, in run_compiled_code
    func(code, glb, loc)
  File "run-tests.xsh", line 26, in <module>
    ![pytest @(replace_args(0)) @(ignores)]
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py", line 1019, in subproc_captured_hiddenobject
    return run_subproc(cmds, captured="hiddenobject")
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/built_ins.py", line 978, in run_subproc
    command.end()
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/proc.py", line 2150, in end
    self._end(tee_output=tee_output)
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/proc.py", line 2169, in _end
    self._raise_subproc_error()
  File "/builddir/build/BUILDROOT/xonsh-0.9.21-1.fc34.x86_64/usr/lib/python3.10/site-packages/xonsh/proc.py", line 2295, in _raise_subproc_error
    raise subprocess.CalledProcessError(rtn, spec.args, output=self.output)
subprocess.CalledProcessError: Command '['pytest', '--ignore', 'tests/test_parser.py', '--ignore', 'tests/test_main.py', '--ignore', 'tests/test_ptk_highlight.py']' returned non-zero exit status 1.
error: Bad exit status from /var/tmp/rpm-tmp.vZ9Qgv (%check)
    Bad exit status from /var/tmp/rpm-tmp.vZ9Qgv (%check)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01773536-xonsh/

For all our attempts to build xonsh with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/xonsh/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Tomáš Hrnčiar 2021-01-20 15:07:40 UTC
Hello, is there any update on this? It blocks testing of 2 other packages (python-virtualenv, asv) with Python 3.10. Thank you.

Comment 2 Miro Hrončok 2021-01-20 15:37:52 UTC
xonsh tests of virtualenv are optional. I recommend disabling them for Python 3.10, as xonsh is likely to not be fixed in time for the actual bootstrap, based on my previous experience.

Comment 3 Tomáš Hrnčiar 2021-01-21 10:20:36 UTC
Thank you for the hint Miro. With disabled failing tests xonsh, python-virtualenv and asv are building just fine.

Comment 4 Carmen Bianca Bakker 2021-01-26 14:29:27 UTC
Hi sorry. I just finished getting my degree this week.

This package has been incredibly difficult to maintain as the Python versions tally up. Tests always break, and upstream appears to be a few Python releases behind. I suspect that the upstream maintainer runs a Debian-like stable distribution.

I'm going to try to figure out some upstream patches. In the meantime it's very acceptable that this package should not block anything. If the package continues being un-maintainable I might retire it.

Comment 5 Ben Cotton 2021-02-09 15:26:17 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


Note You need to log in before you can comment on or make changes to this bug.