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

python3.9 support in resources/tests? #28692

Closed
ArthurSonzogni opened this issue Apr 26, 2021 · 4 comments
Closed

python3.9 support in resources/tests? #28692

ArthurSonzogni opened this issue Apr 26, 2021 · 4 comments

Comments

@ArthurSonzogni
Copy link
Member

ArthurSonzogni commented Apr 26, 2021

(PS: I have very little knowledge about python)

I have issues running the internal tests from: resources/tests.

I was using python2.7 and it was working fine. Then incompatibles changes were introduced and then support for py27 removed.

tox is now configured to run on py36 and py38 only. However on glinux, I get the error:

ERROR: invocation failed (exit code 1), logfile: /home/arthursonzogni/programmation/real/wpt/resources/test/.tox/py38/log/py38-0.log
============================================================= log start =============================================================
RuntimeError: failed to query /usr/bin/python3.8 with code 1 err: 'Traceback (most recent call last):\n  File "/usr/local/lib/python3.9/dist-packages/virtualenv/discovery/py_info.py", line 16, in <module>\n    from distutils import dist\nImportError: cannot import name \'dist\' from \'distutils\' (/usr/lib/python3.8/distutils/__init__.py)\n'

This is because glinux moved from python 3.8 toward python 3.9 (recently ~3 weeks ago). You can still install python3.8 but the package python3-distutils for 3.9 is now breaking 3.8.

See: https://yaqs.corp.google.com/eng/q/1466141581034651648
See: https://yaqs.corp.google.com/eng/q/5091265084522496

As a result, it is not possible on glinux to run WPT internal tests anymore.

Maybe we should add support for py39? This would fix the problem. I tried running tox with py39, but this doesn't work as-is, due to a deprecated function in 3.2 removed in 3.9
ocrmypdf/OCRmyPDF#583

conftest.py:115: in __init__
    for element in parsed.getiterator():
E   AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'

cc @web-platform-tests/wpt-core-team

@foolip
Copy link
Member

foolip commented Apr 26, 2021

@jgraham how do you think we should deal Python 3.9? Should we add it to the various tox.ini so that it can be tested locally? Should we also use 3.9 in CI by default, relegating 3.8 to the same untested-but-probably-working status as 3.7?

@jgraham
Copy link
Contributor

jgraham commented Apr 27, 2021

#28713 perhaps?

@foolip
Copy link
Member

foolip commented Apr 27, 2021

Thanks @ArthurSonzogni for digging into that error. Looks like for element in parsed.iter() should be the fix if the docs are correct. I'll try that in #28713.

@ArthurSonzogni
Copy link
Member Author

Thanks @foolip !

This can be closed, fixed by: ebc9eba

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