zc.buildout recipe to parse pip config files ang use parsed info in a buildout.
Project description
.. contents::
Overview
========
This recipe allows to parse pip configuration files (usually named requirements.txt) into just list of the eggs to use
in other parts of the buildout.
The recipe mirrors the parsed eggs list into its section, so that e.g.
``${pip:eggs}`` will give the list of parsed eggs.
For now single option of the recipe is ``configs`` - list of config files to parse.
The config files are parsed during the initialization of the ``Recipe`` instance,
i.e. after ``buildout.cfg`` is read but before any recipe is installed or updated.
Example usage: Use an environment variable
==========================================
Let's create test config files
>>> write('requirements.txt',
... """
... some.egg
... -e http://some.package.git.url#egg=develop.egg
... """)
>>> write('requirements2.txt',
... """
... some2.egg
... -e http://some2.package.git.url#egg=develop2.egg
... """)
We'll start by creating a buildout that uses the recipe::
>>> write('buildout.cfg',
... """
... [buildout]
... parts = pip print
...
... [some-section]
... eggs = ${pip:eggs}
...
... [pip]
... recipe = collective.recipe.pip
... configs = requirements.txt
... requirements2.txt
...
... [print]
... recipe = mr.scripty
... install =
... ... print self.buildout['some-section']['eggs']
... ... return []
... """)
The `mr.scripty`_ recipe is used to print out the value of the ${some-section:some-option}
option.
Running the buildout gives us::
>>> print 'start', system(buildout)
start...
some.egg
develop.egg
some2.egg
develop2.egg
<BLANKLINE>
Contributors
============
Anatoly Bubenkov <bubenkoff@gmail.com>, Author
Changelog
=========
0.1.0 (2012-12-22)
------------------
- First release.
Overview
========
This recipe allows to parse pip configuration files (usually named requirements.txt) into just list of the eggs to use
in other parts of the buildout.
The recipe mirrors the parsed eggs list into its section, so that e.g.
``${pip:eggs}`` will give the list of parsed eggs.
For now single option of the recipe is ``configs`` - list of config files to parse.
The config files are parsed during the initialization of the ``Recipe`` instance,
i.e. after ``buildout.cfg`` is read but before any recipe is installed or updated.
Example usage: Use an environment variable
==========================================
Let's create test config files
>>> write('requirements.txt',
... """
... some.egg
... -e http://some.package.git.url#egg=develop.egg
... """)
>>> write('requirements2.txt',
... """
... some2.egg
... -e http://some2.package.git.url#egg=develop2.egg
... """)
We'll start by creating a buildout that uses the recipe::
>>> write('buildout.cfg',
... """
... [buildout]
... parts = pip print
...
... [some-section]
... eggs = ${pip:eggs}
...
... [pip]
... recipe = collective.recipe.pip
... configs = requirements.txt
... requirements2.txt
...
... [print]
... recipe = mr.scripty
... install =
... ... print self.buildout['some-section']['eggs']
... ... return []
... """)
The `mr.scripty`_ recipe is used to print out the value of the ${some-section:some-option}
option.
Running the buildout gives us::
>>> print 'start', system(buildout)
start...
some.egg
develop.egg
some2.egg
develop2.egg
<BLANKLINE>
Contributors
============
Anatoly Bubenkov <bubenkoff@gmail.com>, Author
Changelog
=========
0.1.0 (2012-12-22)
------------------
- First release.
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
Close
Hashes for collective.recipe.pip-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88314a219357acbece9a88e2b8491c44ea9e2c9a909e6da474833161099ff259 |
|
MD5 | 94c44e08f17c67774e4635ddf090a5ed |
|
BLAKE2b-256 | 0d8c997bafa41c3393eaf7f94a86d2015ba9075a7101da61ac8e5b55b7c20277 |