Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chameleon benchmark fails on the master branch of Python #47

Closed
vstinner opened this issue Oct 17, 2018 · 5 comments
Closed

chameleon benchmark fails on the master branch of Python #47

vstinner opened this issue Oct 17, 2018 · 5 comments

Comments

@vstinner
Copy link
Member

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
vstinner added a commit that referenced this issue Oct 17, 2018
These benchmarks are incompatible with Python 3.8 yet.
@vstinner
Copy link
Member Author

The commit 2629c5f disables the benchmark.

@vstinner
Copy link
Member Author

I reported the issue upstream: malthe/chameleon#272

@serhiy-storchaka
Copy link
Member

The latest Chameleon version should work on the current master.

@vstinner
Copy link
Member Author

The latest Chameleon version should work on the current master.

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

vstinner added a commit that referenced this issue May 10, 2019
These benchmarks were disabled until they became compatible with
Python 3.8.
@vstinner
Copy link
Member Author

Fixed in commit e915acc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants