add an option to exclude site-packages
Bug #429383 reported by
Martijn Faassen
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Buildout |
New
|
Undecided
|
Unassigned |
Bug Description
We need an option in buildout that can be used to run the buildout without including site-packages.
With the Grok project we now advise people to create the buildouts inside a virtualenv which is installed with --no-site-packages. This to avoid the frequent problem that Python library installed by the platform conflicts with a Python library that Grok itself wants to install. On Mac OS X in particular this problem is guaranteed.
This complicates the installation instructions significantly. buildout is so close: buildout is all about controlling the environment, but always pulls in site-packages, an uncontrolled area.
To post a comment you must log in.
One possible implementation strategy would be to add the following to the generated scripts,
after the sys.path assignment:
import site kages(site_ packages) difference( site_packages)
packages = set(sys.path)
site_packages = set()
site.addsitepac
packages = packages.
sys.path = list(packages)
What this does is add the site packages according to the 'site' module, and then remove them from the path again.
We could make it an option in buildout.cfg or an option to bin/buildout. The problem with doing this to bin/buildout means that people could accidentally add site-packages again when they re-run buildout. Since this is a problem that especially beginners run into, this seems rather risky. Or we could do both.