conda-forge / python-feedstock

A conda-smithy repository for python.
BSD 3-Clause "New" or "Revised" License
45 stars 104 forks source link

Add python_site_packages_path for 3.13 GIL/free threading support #715

Open intentionally-left-nil opened 1 week ago

intentionally-left-nil commented 1 week ago

Comment:

One challenge for Python 3.13 is that the location of the site_packages changes depending on which version is installed. The GIL location is lib/python3.13/site-packages and the Free Threading version is lib/python3.13t/site-packages

@isuruf has already worked around the issue here: https://github.com/conda-forge/python-feedstock/commit/bdc3eebd6de855efc104feb181ba61430e5133ea for this feedstock.

It includes a workaround to add both directories to the site (via site.addsitedir(d)) so that python will find packages installed into either place.

In order to make this system more robust, and have better support for the broader conda ecosystem (e.g. packages built by Anaconda, conda-forge) as well as other python runtimes, there's a CEP proposal

to add python_site_packages_path to the feedstock.

There's a few followup items for conda-forge:

  1. To see if we have alignment on the CEP for how to handle the site_package issue with 3.13
  2. To update the feedstock to set the python_site_packages_path metadata appropriately.

@isuruf gave an ✅ approval to the CEP - awesome! Are there any other folks who need to look at this from the conda-forge side?

If we're aligned on the path forwards, we can implement the second task in the conda-forge feedstock once conda-build is updated to know about the new field.

isuruf commented 1 week ago

We will update this feedstock once the CEP is in, but keep the workaround to support older conda/mamba.