Creates a unified directory structure of all namespace packages, symlinking to the actual contents, in order to ease navigation.
Project description
Code repository: http://svn.plone.org/svn/collective/buildout/collective.recipe.omelette/trunk
Change history
0.4 (2008-04-07)
Added option to include Products directories. [davisagli]
Fixed ignore-develop option. [davisagli]
0.3 (2008-03-30)
Fixed test infrastructure. [davisagli]
Added option to ignore develop eggs [claytron]
Added option to ignore eggs [claytron]
Added option to override the default omelette location. [davisagli]
0.2 (2008-03-16)
Fixed so created directories are not normalized to lowercase. [davisagli]
0.1 (2008-03-10)
Initial basic implementation. [davisagli]
Created recipe with ZopeSkel. [davisagli]
Detailed Documentation
Introduction
Namespace packages offer the huge benefit of being able to distribute parts of a large system in small, self-contained pieces. However, they can be somewhat clunky to navigate, since you end up with a large list of eggs in your egg cache, and then a seemingly endless series of directories you need to open to actually find the contents of your egg.
This recipe sets up a directory structure that mirrors the actual python namespaces, with symlinks to the egg contents. So, instead of this…:
egg-cache/ my.egg.one-1.0-py2.4.egg/ my/ egg/ one/ (contents of first egg) my.egg.two-1.0-py2.4.egg/ my/ egg/ two/ (contents of second egg)
…you get this:
omelette/ my/ egg/ one/ (contents of first egg) two/ (contents of second egg)
Caveat 1: Don’t try to manually add any eggs to the omelette!
Caveat 2: This only works with filesystems that support symlinks (so no go on Windows).
Supported options
The recipe supports the following options:
- eggs
List of eggs which should be included in the omelette.
- location
(optional) Override the directory in which the omelette is created (default is parts/[name of buildout part])
- ignore-develop
(optional) Ignore eggs that you are currently developing (listed in ${buildout:develop}). Default is False
- ignores
(optional) List of eggs to ignore when preparing your omelette.
- products
(optional) List of old Zope 2-style products directories whose contents should be included in the omelette, in a directory called Products.
Example usage
Usage is pretty basic. The following installs a buildout and omelette featuring the setuptools egg (for the sake of example, since it has no dependencies):
>>> write('buildout.cfg', ... """ ... [buildout] ... eggs = setuptools ... parts = omelette ... ... [omelette] ... recipe = collective.recipe.omelette ... eggs = ${buildout:eggs} ... """)
Running the buildout gives us:
>>> print system(buildout) Installing omelette. <BLANKLINE>
Now we have an easily navigable link:
>>> import os >>> os.path.exists('parts/omelette/setuptools') True >>> ls('parts/omelette') d setuptools
And it points to the real location of the egg’s contents:
>>> os.readlink('parts/omelette/setuptools') '/sample-buildout/eggs/setuptools-....egg/setuptools'
You can also include old-style Products directories in the omelette (for Zope developers):
>>> write('buildout.cfg', ... """ ... [buildout] ... parts = ... productdistros ... omelette ... ... [productdistros] ... recipe = plone.recipe.distros ... urls = http://plone.org/products/pressroom/releases/3.1/pressroom-3-1.tgz ... ... [omelette] ... recipe = collective.recipe.omelette ... products = ... ${productdistros:location} ... ${buildout:directory}/duplicate-product-test ... """) >>> mkdir('duplicate-product-test') >>> mkdir('duplicate-product-test/PressRoom') >>> print system(buildout + ' -q')
Any subdirectories of the products directories will be added to the omelette:
>>> ls('parts/omelette/Products') d PressRoom
If a subdirectory of the same name appears in two different product directories, the first one encountered will take precedence:
>>> os.readlink('parts/omelette/Products/PressRoom') '/sample-buildout/parts/productdistros/PressRoom'
If we call the part something else, the omelette should be created there instead (and the old one removed):
>>> write('buildout.cfg', ... """ ... [buildout] ... eggs = setuptools ... parts = frittata ... ... [frittata] ... recipe = collective.recipe.omelette ... eggs = ${buildout:eggs} ... """) >>> print system(buildout + ' -q') >>> os.path.exists('parts/omelette') False >>> os.path.exists('parts/frittata') True
You can also override the location of the omelette if you want to put it somewhere else entirely:
>>> write('buildout.cfg', ... """ ... [buildout] ... eggs = setuptools ... parts = omelette ... ... [omelette] ... recipe = collective.recipe.omelette ... eggs = ${buildout:eggs} ... location = ${buildout:directory}/omelette ... """) >>> print system(buildout + ' -q') >>> os.path.exists('omelette') True
You can ignore a particular package:
>>> write('buildout.cfg', ... """ ... [buildout] ... eggs = setuptools ... parts = omelette ... ... [omelette] ... recipe = collective.recipe.omelette ... eggs = ${buildout:eggs} ... ignores = setuptools ... """) >>> print system(buildout + ' -q') >>> os.path.exists('parts/omelette/setuptools') False
Or ignore all development eggs:
>>> write('buildout.cfg', ... """ ... [buildout] ... eggs = collective.recipe.omelette ... parts = omelette ... ... [omelette] ... recipe = collective.recipe.omelette ... eggs = ${buildout:eggs} ... ignore-develop = true ... """) >>> print system(buildout + ' -q') >>> ls('parts/omelette') d setuptools d zc
Running the tests
The subversion checkout of collective.recipe.omelette includes a buildout which installs a script for running the tests.
- Just run::
python2.4 bootstrap.py bin/buildout bin/test
Known issue: The tests run buildout in a separate process, so it’s currently impossible to put a pdb breakpoint in the recipe and debug during the test. If you need to do this, set up another buildout which installs an omelette part and includes collective.recipe.omelette as a development egg.
Reporting bugs or asking questions
There is a shared bugtracker and help desk on Launchpad: https://bugs.launchpad.net/collective.buildout/
Contributors
David Glick [davisagli], Author
Clayton Parker [claytron], Code Monkey
Download
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file collective.recipe.omelette-0.4.tar.gz
.
File metadata
- Download URL: collective.recipe.omelette-0.4.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d3b964db23bc1e95838c437fec87a428b0e3bc3e2fd873379745edc64ef6e1c8
|
|
MD5 |
36eb2ee57d29aa282db4c7f6a7fb2ce0
|
|
BLAKE2b-256 |
d65c86bd3be525c9160159e6d4a183a9227aa03de9ec11eac64ea55c3c5dab37
|
File details
Details for the file collective.recipe.omelette-0.4-py2.4.egg
.
File metadata
- Download URL: collective.recipe.omelette-0.4-py2.4.egg
- Upload date:
- Size: 12.8 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
9901e1f12a64a70676993d3a2299dbc7ae5ec4aff319dbc46c87291cf65c92ef
|
|
MD5 |
6058c9ab0f1bea5bbd4c7ed62ad60910
|
|
BLAKE2b-256 |
6c79d60d76f7799f335a26b502c9ee2426c9c0c2a71b9c5d17237ee5bfdf2f38
|