Commits

Gael Pasgrimaud  committed 9374362

improve documentation / tests

  • Participants
  • Parent commits 83abba9
  • Tags 0.3

Comments (0)

Files changed (5)

File gp/recipe/pip/README.txt

 editables
     A list of svn url. (`svn+http://myrepo/svn/MyApp#egg=MyApp`)
 
+eggs
+    A list of distribution to install with buildout
+
 This recipe is based on `zc.recipe.egg#scripts
 <http://pypi.python.org/pypi/zc.recipe.egg#id23>`_ so options used by this
 recipe should also works.
     -  paster
     -  python
 
+With the virtualenv binary as executable::
+
+    >>> print 'cat', cat('bin', 'Paster')
+    cat .../parts/pip/bin/python
+    ...
+
+Complete Example
+================
+
 Here is a config file used to install Deliverance::
 
   [buildout]
-  parts = deliverance
+  parts = eggs
   download-cache = download
+  versions = versions
 
-  [deliverance]
+  [versions]
+  # the recipe take care of versions
+  lxml=2.2alpha1
+
+  [eggs]
   recipe = gp.recipe.pip
+  # packages to install with pip
   install =
       Cython
-      --install-option=--static-deps lxml==2.2alpha1
+      --install-option=--static-deps lxml
       http://deliverance.openplans.org/dist/Deliverance-snapshot-latest.pybundle
 
+  # packages to install with buildout
+  eggs =
+      pyquery
+
+  # svn urls
+  editables =
+      svn+http://...
+

File gp/recipe/pip/__init__.py

             options[k] = self.options[k]
 
         # add eggs found in venv to eggs option
-        options['eggs'] = '\n'.join(eggs) + '\n' + self.options.get('eggs')
+        options['eggs'] = '\n'.join(eggs) + '\n' + self.options.get('eggs', '')
 
         # add VCS path as extra_paths
         extra_paths = glob.glob(join(src_dir, '*'))

File gp/recipe/pip/tests.txt

+Versions::
+
+    >>> import os
+    >>> os.makedirs('download')
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... download-cache = download
+    ... parts = test1
+    ... versions = versions
+    ... [versions]
+    ... PasteScript=1.7.2
+    ... [test1]
+    ... recipe = gp.recipe.pip
+    ... install =
+    ...     PasteScript
+    ... interpreter = python
+    ... scripts =
+    ...     paster = paster
+    ... """)
+
+    >>> print 'start', system(buildout) 
+    start...
+    ...Installing /sample-buildout/parts/pip/lib/python2.5/site-packages/PasteScript-1.7.2-py2.5-nspkg.pth
+    ...
+
+    >>> print 'cat', cat('bin', 'Paster')
+    cat .../parts/pip/bin/python
+    ...
+
+    >>> ls('download')
+    d  dist
+    -  http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPaste%2FPaste-1.7.2.tar.gz
+    -  http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPaste%2FPaste-1.7.2.tar.gz.content-type
+    -  http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPasteDeploy%2FPasteDeploy-1.3.2.tar.gz
+    -  http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPasteDeploy%2FPasteDeploy-1.3.2.tar.gz.content-type
+    -  http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPasteScript%2FPasteScript-1.7.2.tar.gz
+    -  http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPasteScript%2FPasteScript-1.7.2.tar.gz.content-type
+    

File gp/recipe/pip/tests/test_docs.py

 Doctest runner for 'gp.recipe.pip'.
 """
 __docformat__ = 'restructuredtext'
-
+import os
 import unittest
 import zc.buildout.tests
 import zc.buildout.testing
                 tearDown=zc.buildout.testing.buildoutTearDown,
                 optionflags=optionflags,
                 checker=renormalizing.RENormalizing([
-                        # If want to clean up the doctest output you
-                        # can register additional regexp normalizers
-                        # here. The format is a two-tuple with the RE
-                        # as the first item and the replacement as the
-                        # second item, e.g.
-                        # (re.compile('my-[rR]eg[eE]ps'), 'my-regexps')
+                        zc.buildout.testing.normalize_path,
+                        ]),
+                ),
+            doctest.DocFileSuite(
+                '../tests.txt',
+                setUp=setUp,
+                tearDown=zc.buildout.testing.buildoutTearDown,
+                optionflags=optionflags,
+                checker=renormalizing.RENormalizing([
                         zc.buildout.testing.normalize_path,
                         ]),
                 ),
 def read(*rnames):
     return open(os.path.join('.', *rnames)).read()
 
-version = '0.2'
+version = '0.3'
 
 long_description = (
     read('README.txt')