From e5e894fa712563f395267a8df85444bf40179a5f Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Oct 2024 10:40:48 -0500 Subject: [PATCH 1/4] use a pth --- recipe/build_base.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index 109c003a4..4ba36df02 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -516,5 +516,23 @@ if [[ "$target_platform" == linux-* ]]; then rm ${PREFIX}/include/uuid.h fi -# See ${RECIPE_DIR}/sitecustomize.py -cp "${RECIPE_DIR}/sitecustomize.py" "${PREFIX}/lib/python${VERABI}/sitecustomize.py" +# Workaround for https://github.com/conda/conda/issues/14053 +# Older conda versions install noarch: python packages in wrong places. +# For example python3.1 because older conda assumed python minor version +# will have only one digit. noarhc pkgs for freethreading builds are supposed +# to be installed into /lib/python3.13t/site-packages, but conda +# installs them to /lib/python3.13/site-packages. +# The workaround is to add all these wrong paths to sys.path using +# site.addsitedir so that cpython and other tools like pip know about these +# locations to check when importing packages and uninstalling packages. +# When installing packages, pip will use the correct location +# /lib/python3.13t/site-packages. +SP_DIR="${PREFIX}/lib/python${PY_VER}{THREAD}/site-packages" +if [[ ${PY_FREETHREADING} == yes ]]; then + echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth +fi +# Workaround for https://github.com/conda/conda/issues/10969 +echo "${PREFIX}/lib/python3.1/site-packages" >> $SP_DIR/conda-site.pth +# A python version independent directory that ABI3 and noarch packages can use. +# This is unused at the moment, but keeping it here for experimentation. +echo "${PREFIX}/lib/python/site-packages" >> $SP_DIR/conda-site.pth From 28df023b1d7120318af8fb9629dbde70eeab1e64 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Oct 2024 13:08:12 -0500 Subject: [PATCH 2/4] fix typo --- recipe/build_base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index 4ba36df02..caddc63ad 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -527,7 +527,7 @@ fi # locations to check when importing packages and uninstalling packages. # When installing packages, pip will use the correct location # /lib/python3.13t/site-packages. -SP_DIR="${PREFIX}/lib/python${PY_VER}{THREAD}/site-packages" +SP_DIR="${PREFIX}/lib/python${PY_VER}${THREAD}/site-packages" if [[ ${PY_FREETHREADING} == yes ]]; then echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth fi From 8c2b103e5bc427b8f2c5866a63528de19c1190bf Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 8 Oct 2024 13:15:21 -0500 Subject: [PATCH 3/4] Update comment --- recipe/build_base.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index caddc63ad..fbb47502f 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -523,10 +523,11 @@ fi # to be installed into /lib/python3.13t/site-packages, but conda # installs them to /lib/python3.13/site-packages. # The workaround is to add all these wrong paths to sys.path using -# site.addsitedir so that cpython and other tools like pip know about these +# a pth file so that cpython and other tools like pip know about these # locations to check when importing packages and uninstalling packages. # When installing packages, pip will use the correct location # /lib/python3.13t/site-packages. +# Note that these directories are not added to sys.path if they do not exist. SP_DIR="${PREFIX}/lib/python${PY_VER}${THREAD}/site-packages" if [[ ${PY_FREETHREADING} == yes ]]; then echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth From 67629ca0f6f888f763a7a3b90168c942c5b2c33a Mon Sep 17 00:00:00 2001 From: Charles Bousseau Date: Wed, 30 Oct 2024 14:19:07 -0400 Subject: [PATCH 4/4] enable no-gil --- recipe/conda_build_config.yaml | 3 +-- recipe/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index b5feefcf3..32efc9889 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -6,5 +6,4 @@ numpy: - 1.26 gil_type: - normal - # Will be enabled as part of https://anaconda.atlassian.net/browse/PKG-5855 - # - disabled # [not (s390x or (osx and x86_64))] + - disabled # [not s390x] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d24882ca4..e2d214a33 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} {% set ver3nd = ''.join(version.split('.')[0:3]) %} -{% set build_number = 0 %} +{% set build_number = 1 %} {% set channel_targets = ('abc', 'def') %} # this is just for the initial build, to break dependencies with python -> pip -> libpython-static {% set bootstrap = "false" %}