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

WIP: Add Python 3.13 support #49503

Conversation

MichaelMcDonnell
Copy link

This is a work in progress to add Python 3.13 support as requested in issue #48585. I'm trying to get help with it because it fails inside the Python logging code, and I don't know how to fix that. I suspect it might be a threading issue related to importlib.reload.

The 'cgi' module was removed in Python 3.13. The legacy-cgi module is a drop-in replacement for projects not ready to upgrade to a better approach. I've added that to the requirements. The newer version of the pillow module was also required.

I also ran into an issue with the version of zstandard. Some internal C functions have been removed in Python 3.13 which resulted in cffi errors.

These changes required increasing the minimum Python version from 3.8 to 3.10.

Again, help is very welcome.

This is a work in progress to add Python 3.13 support as requested
in issue web-platform-tests#48585. I'm trying to get help with it because it fails
inside the Python logging code, and I don't know how to fix that. I
suspect it might be a threading issue related to importlib.reload.

The 'cgi' module was removed in Python 3.13. The `legacy-cgi` module
is a drop-in replacement for projects not ready to upgrade to a better
approach. I've added that to the requirements. The newer version of
the `pillow` module was also required.

I also ran into an issue with the version of `zstandard`. Some
internal C functions have been removed in Python 3.13 which resulted
in cffi errors.

These changes required increasing the minimum Python version from 3.8
to 3.10.

Again, help is very welcome.

Signed-off-by: Michael Mc Donnell <[email protected]>
@MichaelMcDonnell
Copy link
Author

Looks like wptserve needs legacy-cgi too. I tried adding a requirements.txt file in tools/wptserve and changed the tools/serve/commands.json to use the requirements.txt. That caused the ./wpt serve command to say it needs a virtual environment, so I set the virtualenv value to true. I then got an exception "TypeError: 'Virtualenv' object is not callable" that I haven't been able to solve.

@MichaelMcDonnell MichaelMcDonnell marked this pull request as draft December 3, 2024 22:26
@gsnedders
Copy link
Member

These changes required increasing the minimum Python version from 3.8 to 3.10.

That's going to be a non-starter, FWIW. See web-platform-tests/rfcs#200 for the latest discussion I'm aware of about moving the minimum version to 3.9. That said, it's unclear what here requires 3.10? Pillow has dropped support for 3.8, and we can always rely on the older version of Pillow for <3.9.

As for legacy-cgi: the usage seems to basically just be tools/wptserve/wptserve/request.py, and wptserve needs to be usable without any dependencies installed currently (see web-platform-tests/rfcs#82 (comment); cc @jgraham).

@MichaelMcDonnell
Copy link
Author

That said, it's unclear what here requires 3.10?

The legacy-cgi module requires Python 3.10 according to https://pypi.org/project/legacy-cgi/

Thank you @gsnedders for linking to those issues and explaining the situation to me. It sounds like the enterprise users are using old versions of Python, the WPT project is maintained by people working at those enterprises, and the WPT project is therefore prioritizing supporting old versions of Python instead of newer versions?

I'll stop working on the upgrade since I don't see a way to both support that old versions of Python and the current version. Python is deprecating and removing things quickly at the moment. Thank you again for the help, I appreciate it.

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

Successfully merging this pull request may close these issues.

4 participants