Skip to main content

recipe for patching eggs

Project description

This is first public release just so people can try it out.

Detailed Documentation

Supported options

The recipe supports the following options:

egg

Define which egg should be patched. You can also pin to version. example: some.egg<=1.1.1

patch

Path to patch file. example: patches/my_very_sprecial.patch

Example usage

Our demo package which will patch.

>>> mkdir(sample_buildout, 'demo')
>>> write(sample_buildout, 'demo', 'README.txt', " ")
>>> write(sample_buildout, 'demo', 'demo.py',
... """# demo egg
... """)
>>> write(sample_buildout, 'demo', 'setup.py',
... """
... from setuptools import setup
...
... setup(
...     name = "demo",
...     version='1.0',
...     py_modules=['demo']
...     )
... """)
>>> print system(buildout+' setup demo bdist_egg'), # doctest: +ELLIPSIS
Running setup script 'demo/setup.py'.
...

Create out patch.

>>> write(sample_buildout, 'demo.patch',
... """diff --git demo.py demo.py
... --- demo.py
... +++ demo.py
... @@ -1 +1,2 @@
...  # demo egg
... +# patching
... """)

Let now write out buildout.cfg to patch our demo package

>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = demo-eggs demo-patch
... index = %(dist)s
...
... [demo-eggs]
... recipe = zc.recipe.egg
... eggs = demo
...
... [demo-patch]
... recipe = collective.recipe.patch
... egg = %(egg)s
... patch = %(patch)s
... """ % { 'egg'   : 'demo==1.0',
...         'patch' : 'demo.patch',
...         'dist'  : join('demo', 'dist'), })

Running the buildout gives us:

>>> print 'start', system(buildout)
start Not found: demo/dist/zc.buildout/
...
>>> ls(sample_buildout, 'eggs-patched')
d  demo-1.0-py2.4.egg
>>> cat(sample_buildout, 'demo', 'demo.py')
# demo egg
>>> cat(sample_buildout, 'eggs-patched', 'demo-1.0-py2.4.egg', 'demo.py')
# demo egg
# patching

Contributors

Rok Garbas, Author

Change history

0.1 (xxxx-xx-xx)

  • Created recipe with ZopeSkel [Rok Garbas].

Download

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

collective.recipe.patch-0.1b1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

collective.recipe.patch-0.1b1-py2.4.egg (7.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page