Skip to content

chameleon benchmark fails on the master branch of Python #47

Closed

Description

@vstinner

performance 0.7.0 fails on the master branch of Python (future Python 3.8), because Chameleon has no handler for AST node type ast.Constant.

performance 0.7.0 uses Chameleon 3.4. I see two options:

  • Disable/remove the benchmark
  • Fix Chameleon, wait for a new release, upgrade Chameleon in performance

Chameleon project homepage: https://github.com/malthe/chameleon/

cc @serhiy-storchaka @methane

Full traceback:

2018-10-16 15:28:43,656: [ 2/47] chameleon...
2018-10-16 15:28:43,656: INFO:root:Running `/home/haypo/bench_tmpdir/venv/bin/python -u /home/haypo/performance/performance/benchmarks/bm_chameleon.py --verbose --output /tmp/tmp85spznrk`
2018-10-16 15:28:43,842: Traceback (most recent call last):
2018-10-16 15:28:43,842:   File "/home/haypo/performance/performance/benchmarks/bm_chameleon.py", line 36, in <module>
2018-10-16 15:28:43,843:     main()
2018-10-16 15:28:43,843:   File "/home/haypo/performance/performance/benchmarks/bm_chameleon.py", line 26, in main
2018-10-16 15:28:43,843:     tmpl = PageTemplate(BIGTABLE_ZPT)
2018-10-16 15:28:43,843:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/zpt/template.py", line 192, in __init__
2018-10-16 15:28:43,843:     super(PageTemplate, self).__init__(body, **config)
2018-10-16 15:28:43,843:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/template.py", line 128, in __init__
2018-10-16 15:28:43,843:     self.write(body)
2018-10-16 15:28:43,843:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/template.py", line 221, in write
2018-10-16 15:28:43,843:     self.cook(body)
2018-10-16 15:28:43,843:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/template.py", line 158, in cook
2018-10-16 15:28:43,843:     program = self._cook(body, digest, names)
2018-10-16 15:28:43,843:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/template.py", line 231, in _cook
2018-10-16 15:28:43,844:     source = self._compile(body, builtins)
2018-10-16 15:28:43,844:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/template.py", line 265, in _compile
2018-10-16 15:28:43,844:     compiler = Compiler(
2018-10-16 15:28:43,844:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/compiler.py", line 949, in __init__
2018-10-16 15:28:43,844:     generator = TemplateCodeGenerator(module, source)
2018-10-16 15:28:43,844:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/codegen.py", line 116, in __init__
2018-10-16 15:28:43,844:     super(TemplateCodeGenerator, self).__init__(tree)
2018-10-16 15:28:43,844:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 226, in __init__
2018-10-16 15:28:43,844:     self.visit(tree)
2018-10-16 15:28:43,844:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/codegen.py", line 201, in visit
2018-10-16 15:28:43,844:     super(TemplateCodeGenerator, self).visit(node)
2018-10-16 15:28:43,845:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 286, in visit
2018-10-16 15:28:43,845:     ret = visitor(node)
2018-10-16 15:28:43,845:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/codegen.py", line 119, in visit_Module
2018-10-16 15:28:43,845:     super(TemplateCodeGenerator, self).visit_Module(node)
2018-10-16 15:28:43,845:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 293, in visit_Module
2018-10-16 15:28:43,845:     self.visit(n)
2018-10-16 15:28:43,845:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/codegen.py", line 201, in visit
2018-10-16 15:28:43,845:     super(TemplateCodeGenerator, self).visit(node)
2018-10-16 15:28:43,845:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 286, in visit
2018-10-16 15:28:43,845:     ret = visitor(node)
2018-10-16 15:28:43,845:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 387, in visit_Assign
2018-10-16 15:28:43,846:     self.visit(node.value)
2018-10-16 15:28:43,846:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/codegen.py", line 201, in visit
2018-10-16 15:28:43,846:     super(TemplateCodeGenerator, self).visit(node)
2018-10-16 15:28:43,846:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 286, in visit
2018-10-16 15:28:43,846:     ret = visitor(node)
2018-10-16 15:28:43,846:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 829, in visit_Call
2018-10-16 15:28:43,846:     self.visit(arg)
2018-10-16 15:28:43,846:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/codegen.py", line 201, in visit
2018-10-16 15:28:43,846:     super(TemplateCodeGenerator, self).visit(node)
2018-10-16 15:28:43,846:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/chameleon/astutil.py", line 284, in visit
2018-10-16 15:28:43,846:     raise Exception('No handler for ``%s`` (%s).' % (
2018-10-16 15:28:43,846: Exception: No handler for ``Constant`` (<_ast.Constant object at 0x7f42c52f8b80>).
2018-10-16 15:28:43,859: ERROR: Benchmark chameleon failed: Benchmark died

Activity

  1. added a commit that references this issue on Oct 17, 2018
  2. vstinner commented on Oct 17, 2018

    @vstinner
    MemberAuthor

    The commit 2629c5f disables the benchmark.

  3. vstinner commented on Oct 17, 2018

    @vstinner
    MemberAuthor

    I reported the issue upstream: malthe/chameleon#272

  4. serhiy-storchaka commented on Oct 29, 2018

    @serhiy-storchaka
    Member

    The latest Chameleon version should work on the current master.

  5. vstinner commented on Oct 29, 2018

    @vstinner
    MemberAuthor

    The latest Chameleon version should work on the current master.

    Cool! Do you want to write a PR to upgrade Chameleon?

  6. added a commit that references this issue on May 10, 2019
  7. vstinner commented on May 10, 2019

    @vstinner
    MemberAuthor

    Fixed in commit e915acc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions