← Back to issue list

plugins: add sitecustomize.py in PythonPlugin's build

View original Github issue

Metadata

Project
rockcraft
Number
#248
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Merged. Adds sitecustomize.py to PythonPlugin to ensure pip-installed packages are found by the global Python interpreter. Fixed spread test failures and package path ordering before final merge. Resolves CRAFT-1721.

Suggested action:

No scores available.

Issue body

The issue: running a ROCK that was built with the Python plugin by calling "python3" or "/usr/bin/python3" (as opposed to "/bin/python3") fails to find pip-installed packages. The solution implemented with this commit is to add a sitecustomize module that always adds the location of the pip-installed packages to sys.path. This ensures that the pip-installed packages are found even if the "global" Python interpreter is called. CRAFT-1721

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged. Adds sitecustomize.py to PythonPlugin to ensure pip-installed packages are found by the global Python interpreter. Fixed spread test failures and package path ordering before final merge. Resolves CRAFT-1721.
qwen3.6-35b-a3b-mtp-q6 Merged. Adds sitecustomize.py to PythonPlugin's build to ensure pip packages are found when invoking python3 or /usr/bin/python3. Resolved spread test failures and fixed package directory ordering before merge.
qwen3.6-35b-a3b-mtp-q6 Merged. Adds sitecustomize.py to PythonPlugin's build to ensure pip-installed packages are found via alternative Python paths. Resolved spread test failures related to package directory order before merging. Addresses CRAFT-1721.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1547 plugins: extract sitecustomize logic from python snapcraft merged Merged a refactoring change extracting sitecustomize.py logic from the Python plugin into a shared module. Approved and passing CI, this prepares the codebase for the subsequent pip extraction without altering current functionality.
75%