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

Multiple pyperformance tests are incompatible with Python 3.9 #74

Closed
TravisLazar opened this issue Nov 13, 2019 · 3 comments
Closed

Multiple pyperformance tests are incompatible with Python 3.9 #74

TravisLazar opened this issue Nov 13, 2019 · 3 comments

Comments

@TravisLazar
Copy link

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 died

How to reproduce the issue

I've been building Python 3 from source and encountered it through the standard build process.

  1. Build Python from source. I produced with git commit befa032d8869e0fab4732d910f3887642879d644 from cpython GitHub.

  2. 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

  1. Error message is shown.

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.

@TravisLazar
Copy link
Author

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

@TravisLazar
Copy link
Author

I cannot reproduce on django_template or tornado_http anymore. It's possible that I got some logs crossed.

The html5lib issue still remains.

@lazka
Copy link
Collaborator

lazka commented Nov 13, 2019

note that html5lib is disabled on master

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