Skip to content

Honour the case when Python disables the user-site-packages directory.

Philip Elson requested to merge pelson/cmmnbuild-dep-manager:no_dot_local into master

Python's documentation claims that site.getusersitepackages respects PYTHONNOUSERSITE, but in fact it doesn't. We can see this by running python -s -c "import site; print(site.getusersitepackages())" and observing that in fact PYTHONNOUSERSITE is entirely disregarded. Instead, what is honoured is that site.ENABLE_USER_SITE does respect that flag, and it is this which prevents the user site packages being added to the sys.path. cmmnbuild-dep-manager should therefore do the same, and listen to the site.ENABLE_USER_SITE attribute in order to decide whether to use the .local directory.

Merge request reports