← Back to team overview

launchpad-dev team mailing list archive

buildout changes

 

Hi all.

Our version of buildout changed significantly in the past 24 hours.

I suggest a make clean && make for existing branches that get the changes.

Devs will probably also need to know about these two concrete changes.

- When you write a script that imports _pythonpath, the shebang line should now end with a -S (e.g., ``#!/usr/bin/python2.5 -S``).  No other changes should be necessary.  [1]

- lib/lp_sitecustomize.py is a place to put in Python customizations that you might normally put in a sitecustomize for a Python dedicated to an application.  [2]

Here a few more concrete details

- Paths are now inserted via parts/scripts/site.py.  Scripts in bin are therefore much shorter.

- The only path necessary to insert in PYTHONPATH for subprocesses to get the full environment is parts/scripts.  In most cases this should already be done for you.

- lib/site.py is gone.

I'll be working on QA this cycle.  Please let me know if you encounter issues.

Thanks

Gary


[1] If your script's shebang does not start with a -S and you do not use bin/py (or python2.5 -S) to start the script, you will get a hopefully helpful error message:

  The wrong site.py is imported. Scripts should usually be
  started with Launchpad's bin/py, or with a Python invoked with
  the -S flag.

[2] sitecustomize does exist (parts/scripts/sitecustomize.py) but changing it is done in buildout.cfg ("[scripts]" section, "initialization" key), which has limitations (indentation is not honored) and is arguably less visible for most devs.  Therefore, it imports lp_sitecustomize: lp_sitecustomize is processed after paths have been inserted by our custom site.py, but before anything else has been processed (such as zcml).