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

feat(pypi): support freethreaded in experimental_index_url #2460

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Dec 1, 2024

With this we:

  • Fix the previous behaviour where abi3 wheels would be selected when
    freethreaded builds are selected. Whilst this may work in practise
    sometimes, I am not sure it has been supported by reading PEP703.
  • Start selecting cp313t wheels when we scan what is available on PyPI.
  • Ensure that the whl_library repository rule handles cp313t wheel
    extraction.
  • Generate cp313t config_settings so that we can use them in
    pkg_aliases.
  • Generate cp313t references in pkg_aliases macro.
  • Add the 3.13 deps to dev_pip for testing.

Also tested by manually running:

$ bazel cquery --//python/config_settings:python_version=3.13 --//python/config_settings:py_freethreaded=yes 'kind("py_library rule", deps(@dev_pip//markupsafe))'
INFO: Analyzed target @@_main~pip~dev_pip//markupsafe:markupsafe (3 packages loaded, 4091 targets configured).
INFO: Found 1 target...
@@_main~pip~dev_pip_313_markupsafe_cp313_cp313t_manylinux_2_17_x86_64_c0ef13ea//:pkg (008c5a5)
$bazel build --//python/config_settings:python_version=3.13 --//python/config_settings:py_freethreaded=yes @dev_pip//markupsafe

Fixes #2386

With this we:
* Fix the previous behaviour where `abi3` wheels would be selected when
  freethreaded builds are selected. Whilst this may work in practise
  sometimes, I am not sure it has been supported by reading PEP703.
* Start selecting `cp313t` wheels when we scan what is available on PyPI.
* Ensure that the `whl_library` repository rule handles `cp313t` wheel
  extraction.
* Generate `cp313t` config_settings so that we can use them in
  `pkg_aliases`.
* Generate `cp313t` references in `pkg_aliases` macro.
* Add the 3.13 deps to dev_pip for testing.

Also tested by manually running:
```
$ bazel cquery --//python/config_settings:python_version=3.13 --//python/config_settings:py_freethreaded=yes 'kind("py_library rule", deps(@dev_pip//markupsafe))'
INFO: Analyzed target @@_main~pip~dev_pip//markupsafe:markupsafe (3 packages loaded, 4091 targets configured).
INFO: Found 1 target...
@@_main~pip~dev_pip_313_markupsafe_cp313_cp313t_manylinux_2_17_x86_64_c0ef13ea//:pkg (008c5a5)
$bazel build --//python/config_settings:python_version=3.13 --//python/config_settings:py_freethreaded=yes @dev_pip//markupsafe
```

Fixes bazelbuild#2386
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

Successfully merging this pull request may close these issues.

Support freethreaded toolchains and wheels
1 participant