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

Support abi3 packages with a python version independent site-packages directory #669

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipe/build_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,6 @@ fi
# Workaround for old conda versions which fail to install noarch packages for Python 3.10+
# https://github.com/conda/conda/issues/10969
ln -s "${PREFIX}/lib/python${VER}" "${PREFIX}/lib/python3.1"

# Add a custom site-packages dir ${PREFIX}/lib/site-packages to install abi3 packages
cp "${RECIPE_DIR}/sitecustomize.py" "${PREFIX}/lib/python${VER}/sitecustomize.py"
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

# this makes the linter happy
{% set channel_targets = channel_targets or 'conda-forge main' %}
Expand Down
2 changes: 2 additions & 0 deletions recipe/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import site, sys, os
site.addsitedir(os.path.join(sys.prefix, 'lib', 'python', 'site-packages'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One advantage of $PREFIX/lib/site-packages is that it matches windows layout.