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

Add support for buildPython version 3.12 #931

Closed
mhsmith opened this issue Aug 10, 2023 · 3 comments
Closed

Add support for buildPython version 3.12 #931

mhsmith opened this issue Aug 10, 2023 · 3 comments
Milestone

Comments

@mhsmith
Copy link
Member

mhsmith commented Aug 10, 2023

Checklist in product/gradle-plugin/README.md.

For runtime support, see #967.

@mhsmith mhsmith added this to the 15.0 milestone Aug 10, 2023
@mhsmith
Copy link
Member Author

mhsmith commented Oct 8, 2023

Critical bug: beeware/briefcase#1480

> Task :app:generateDebugPythonRequirements FAILED
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\android\gradle\app\build\generated\python\bp\chaquopy\pip_install.py", line 23, in <module>
    from pip._internal.utils.misc import rmtree
  File "C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\android\gradle\app\build\generated\python\bp\pip\_internal\utils\misc.py", line 20, in <module>
    from pip._vendor import pkg_resources
  File "C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\android\gradle\app\build\generated\python\bp\pip\_vendor\pkg_resources\__init__.py", line 58, in <module>
    from pip._vendor.six.moves import urllib, map, filter
ModuleNotFoundError: No module named 'pip._vendor.six.moves'

@mhsmith
Copy link
Member Author

mhsmith commented Nov 13, 2023

The error from six in the Briefcase issue was fixed by updating six to a version that's compatible with Python 3.12.

The removal of distutils from the standard library was fixed by updating to the current version of setuptools. We had a few patches in pkg_resources/__init__.py, but I've removed them because it looks like they were connected to putting build-packages.zip directly on the PYTHONPATH, which we don't do anymore. This means we no longer have any patches against upstream setuptools.

@mhsmith
Copy link
Member Author

mhsmith commented Nov 15, 2023

Finally, in order for the setuptools .pth file with the distutils redirection to take effect, we had to stop running pip using python -S, and use a proper virtual environment instead. (This code was originally written for Python 2, which didn't have virtual environment support in the standard library.)

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

No branches or pull requests

1 participant