Skip to content

site.py removal in 49.0.0 breaks eggs installed outside system prefix #2295

@ystreet

Description

@ystreet

site.py was removed in #2165 and first released with setuptools 49.0.0

This now causes installed eggs to not be loaded when installed to a prefix and pointed to by PYTHONPATH.

E.g. a concrete example of this use is with GStreamer's cerbero build system which installs the meson build system to a custom prefix to avoid messing up user/system installations. Relevant code for that is: https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/master/recipes/build-tools/meson.recipe#L30

PYTHONPATH is constructed by cerbero to point to the necessary path for the installed location (e.g. PYTHONPATH=/path/to/cerbero/build/build-tools/lib/python3.8/site-packages/). Without the site.py that is installed, this does not work anymore.

One can reproduce by doing the following:

git clone https://gitlab.freedesktop.org/gstreamer/cerbero.git
cd cerbero
./cerbero-uninstalled -c config/build-tools.cbc build meson
./cerbero-uninstalled shell
python3 -c "import sys; print(sys.path)"
# should output a value containing '/path/to/cerbero/build/build-tools/lib/python3.8/site-packages/meson-0.54.0-py3.8.egg'

Reverting to python-setuptools < 49.0.0 is one workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions