Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMultiple pyperformance tests are incompatible with Python 3.9 #74
Comments
|
Looks like these issues are in the imported libraries themselves. The only thing pyperformance could do is disable the tests in the benchmarks/init.py. I'll file additional issues in the django_template and tornado_http repositories. I believe a patch was already submitted to html5lib: html5lib/html5lib-python@4f92357 |
|
I cannot reproduce on django_template or tornado_http anymore. It's possible that I got some logs crossed. The html5lib issue still remains. |
|
note that html5lib is disabled on master |
Changes in Python 3.9 break html5lib, django_template, and tornado_http tests with this error:
File "/usr/local/src/pyperf-tot-no-venv/lib/python3.9/site-packages/html5lib/_tokenizer.py", line 16, in <module> from ._trie import Trie File "/usr/local/src/pyperf-tot-no-venv/lib/python3.9/site-packages/html5lib/_trie/__init__.py", line 3, in <module> from .py import Trie as PyTrie File "/usr/local/src/pyperf-tot-no-venv/lib/python3.9/site-packages/html5lib/_trie/py.py", line 6, in <module> from ._base import Trie as ABCTrie File "/usr/local/src/pyperf-tot-no-venv/lib/python3.9/site-packages/html5lib/_trie/_base.py", line 3, in <module> from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (/root/py3-tot-no/lib/python3.9/collections/__init__.py) ERROR: Benchmark html5lib failed: Benchmark diedHow to reproduce the issue
I've been building Python 3 from source and encountered it through the standard build process.
Build Python from source. I produced with git commit befa032d8869e0fab4732d910f3887642879d644 from cpython GitHub.
Run pyperformance with one of the following parameter sets:
/py3buildpath/bin/pyperformance run --python=/py3buildpath/bin/python3 --venv venvpath -b html5lib -o output.json
/py3buildpath/bin/pyperformance run --python=/py3buildpath/bin/python3 --venv venvpath -b django_template -o output.json
/py3buildpath/bin/pyperformance run --python=/py3buildpath/bin/python3 --venv venvpath -b tornado_http -o output.json
What you expected to happen
I expected these pyperformance benchmark to complete successfully and produce a result (without error).
What actually happens
Benchmark dies trying to import from collections.
I believe with Python 3.9 these packages need to be directly imported from collections.abc.
See this commit: python/cpython@ef092fe
Here's a patch that was backported to the Python 3 vendored library: pypa/pip@ef7ca14#diff-2496ad1eedee846e323ed2916d6c2d24
This library probably needs an official release so that the vendored patch set in Python 3 doesn't become bloated.