Skip to content

genshi benchmark fails on Python 3.8 #46

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

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

genshi benchmark fails on Python 3.8 #46

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 genshi uses _ast.Str type which is gone from Python 3.8.

visit_Name() at genshi/template/eval.py:616:

strarg = _new(_ast.Str, node.id)

performance 0.7.0 uses Genshi 0.7.1. I see two options:

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

Genshi project homepage: https://genshi.edgewall.org/

cc @serhiy-storchaka @methane

Full traceback:

2018-10-16 15:31:58,023: [10/47] genshi...
2018-10-16 15:31:58,024: INFO:root:Running `/home/haypo/bench_tmpdir/venv/bin/python -u /home/haypo/performance/performance/benchmarks/bm_genshi.py --verbose --output /tmp/tmpace4xllo`
2018-10-16 15:31:58,177: Traceback (most recent call last):
2018-10-16 15:31:58,177:   File "/home/haypo/performance/performance/benchmarks/bm_genshi.py", line 68, in <module>
2018-10-16 15:31:58,178:     runner.bench_time_func(name, bench_genshi, tmpl_cls, tmpl_str)
2018-10-16 15:31:58,178:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_runner.py", line 458, in bench_time_func
2018-10-16 15:31:58,178:     return self._main(task)
2018-10-16 15:31:58,178:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_runner.py", line 423, in _main
2018-10-16 15:31:58,178:     bench = self._worker(task)
2018-10-16 15:31:58,178:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_runner.py", line 397, in _worker
2018-10-16 15:31:58,179:     run = task.create_run()
2018-10-16 15:31:58,179:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_worker.py", line 293, in create_run
2018-10-16 15:31:58,179:     self.compute()
2018-10-16 15:31:58,179:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_worker.py", line 331, in compute
2018-10-16 15:31:58,179:     WorkerTask.compute(self)
2018-10-16 15:31:58,179:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_worker.py", line 280, in compute
2018-10-16 15:31:58,180:     self.calibrate_loops()
2018-10-16 15:31:58,180:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_worker.py", line 243, in calibrate_loops
2018-10-16 15:31:58,180:     self._compute_values(self.warmups, nvalue,
2018-10-16 15:31:58,180:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_worker.py", line 76, in _compute_values
2018-10-16 15:31:58,180:     raw_value = self.task_func(self, self.loops)
2018-10-16 15:31:58,180:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/perf/_runner.py", line 454, in task_func
2018-10-16 15:31:58,181:     return time_func(loops, *args)
2018-10-16 15:31:58,181:   File "/home/haypo/performance/performance/benchmarks/bm_genshi.py", line 29, in bench_genshi
2018-10-16 15:31:58,181:     tmpl = tmpl_cls(tmpl_str)
2018-10-16 15:31:58,181:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/text.py", line 137, in __init__
2018-10-16 15:31:58,181:     Template.__init__(self, source, filepath=filepath, filename=filename,
2018-10-16 15:31:58,181:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/base.py", line 418, in __init__
2018-10-16 15:31:58,181:     self._stream = self._parse(source, encoding)
2018-10-16 15:31:58,182:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/text.py", line 181, in _parse
2018-10-16 15:31:58,182:     for kind, data, pos in interpolate(text, self.filepath, lineno,
2018-10-16 15:31:58,182:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/interpolation.py", line 77, in interpolate
2018-10-16 15:31:58,182:     expr = Expression(chunk.strip(), pos[0], pos[1],
2018-10-16 15:31:58,182:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/eval.py", line 93, in __init__
2018-10-16 15:31:58,182:     self.code = _compile(node, self.source, mode=self.mode,
2018-10-16 15:31:58,183:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/eval.py", line 451, in _compile
2018-10-16 15:31:58,183:     tree = xform().visit(node)
2018-10-16 15:31:58,183:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/astutil.py", line 794, in visit
2018-10-16 15:31:58,183:     return visitor(node)
2018-10-16 15:31:58,183:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/astutil.py", line 816, in _clone
2018-10-16 15:31:58,183:     value = self.visit(value)
2018-10-16 15:31:58,184:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/astutil.py", line 794, in visit
2018-10-16 15:31:58,184:     return visitor(node)
2018-10-16 15:31:58,184:   File "/home/haypo/bench_tmpdir/venv/lib/python3.8/site-packages/genshi/template/eval.py", line 616, in visit_Name
2018-10-16 15:31:58,184:     strarg = _new(_ast.Str, node.id)
2018-10-16 15:31:58,184: AttributeError: module '_ast' has no attribute 'Str'
@vstinner
Copy link
Member Author

The commit 2629c5f disables the benchmark.

@vstinner
Copy link
Member Author

Bug reported upstream: https://genshi.edgewall.org/ticket/612

@serhiy-storchaka
Copy link
Member

I have created a patch for Genshi, but it is hard to test it because currently tests are failed on Python 3.6. Seems Genshi doesn't support Python 3 yet.

@jun66j5
Copy link

jun66j5 commented Oct 17, 2018

Genshi 0.7.x and master currently support 2.6-2.7, 3.2-3.7. See https://travis-ci.org/edgewall/genshi/builds.

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

3 participants