Dump buildout picked versions.
Project description
buildout.dumppickedversions
Q: What is a buildout extension ?
A: http://pypi.python.org/pypi/zc.buildout#extensions
The problem
When using a zc.buildout based deployment system I want to be able to reproduce the same setup with the same set of egg versions one month later. Without pinning all eggs the task is impossible.
Solution
buildout.dumppickedversions is a buildout extension that does just that. It can print or generate a versions.cfg file with all not pinned eggs.
buildout.dumppickedversions options
- dump-picked-versions-file
A file name you want buildout.dumppickedversions to write to. If not given buildout.dumppickedversions will dump the results to the screen.
Detailed Documentation
Let’s create an egg to use it in our tests:
>>> mkdir('myegg') >>> write('myegg', 'setup.py', ... ''' ... from setuptools import setup ... setup(name='myegg', version='1.0',) ... ''') >>> write('myegg', 'README', '') >>> print system(buildout+' setup myegg bdist_egg'), # doctest: +ELLIPSIS Running setup script 'myegg/setup.py'. ...
Now let’s create a buildout to install the egg and to use buildout.dumppickedversions:
>>> write('buildout.cfg', ... ''' ... [buildout] ... extensions = buildout.dumppickedversions ... parts = foo ... find-links = %s ... index = http://pypi.python.org/simple ... [foo] ... recipe = zc.recipe.egg ... eggs = myegg ... ''' % join('myegg', 'dist'))
Running the buildout will print information about picked versions:
>>> print system(buildout), # doctest: +ELLIPSIS Getting distribution for 'buildout.dumppickedversions'. ... *************** PICKED VERSIONS **************** [buildout] <BLANKLINE> versions = versions <BLANKLINE> [versions] zc.buildout = N.N zc.recipe.egg = N.N myegg = N.N setuptools = N.N <BLANKLINE> *************** /PICKED VERSIONS ***************
We can get a file with the picked versions. We just add an dump-picked-versions-file option and give a file name:
>>> write('buildout.cfg', ... ''' ... [buildout] ... extensions = buildout.dumppickedversions ... dump-picked-versions-file = versions.cfg ... parts = foo ... find-links = ... %s ... index = http://pypi.python.org/simple ... [foo] ... recipe = zc.recipe.egg ... eggs = ... myegg ... ''' % join('myegg', 'dist')) >>> print system(buildout), # doctest: +ELLIPSIS Uninstalling foo. Installing foo. Writing picked versions to versions.cfg
And here is the content of the file versions.cfg:
>>> cat('versions.cfg') [buildout] <BLANKLINE> versions = versions <BLANKLINE> [versions] zc.buildout = N.N zc.recipe.egg = N.N myegg = N.N setuptools = N.N <BLANKLINE>
Change history
0.1 (2009-02-07)
Created recipe with ZopeSkel. [mustapha]
Contributors
Mustapha Benali, Author
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for buildout.dumppickedversions-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25dd319108e51d27f15509e7d22f606d22ee6a0ef47a4e41f56277dc2f09d561 |
|
MD5 | 08de486cf884b498562516cd1ab28033 |
|
BLAKE2b-256 | e5715b2c2b1f1ac40069a8ecfd4eaa04ad5e04b593375ade48f46fd5b81a6264 |