Skip to main content

ZC buildout extension to checkout develop eggs

Project description

What is gp.svndevelop ?

This package allow you to checkout some package and use them as developed eggs with zc.buildout.

Why zc.buildout sucks a bit ?

zc.buildout fail When you specify a develop egg who does not exist:

>>> cd(sample_buildout)

>>> write('buildout.cfg','''
... [buildout]
... develop=my.testing
... parts=
... ''')

>>> print system(buildout)
Develop: '/...buildout/my.testing'
Traceback (most recent call last):
...
IOError: [Errno 2] No such file or directory: '/...buildout/my.testing'
...

A solution: a simple checkout before anything else

A solution is to use this package as a zc.buildout extension and to provide some svn urls in the svn-develop option:

>>> write('buildout.cfg','''
... [buildout]
... extensions=gp.svndevelop
... develop=../my.testing
... svn-develop=%s/my.testing/trunk#egg=my.testing
... parts=
... ''' % repository)

Then if you run buildout again, the package will be checkout from the repository:

>>> print system(buildout)
A    my.testing/LICENSE
A    my.testing/my
A    my.testing/my/__init__.py
A    my.testing/my/testing
A    my.testing/my/testing/__init__.py
A    my.testing/my/testing/README.txt
A    my.testing/setup.py
...
Develop: '/...buildout/my.testing'

Notice that the develop option is set to the parent directory but the package is not checked out in it. Why ? Well this is my arbitrary policy. I don’t want to have extra eggs out of my buildout environment.

Using eggs in an existing directory

This extension is also a way to use an existing directory. Imagine you already have the my.testing package in a directory:

>>> ls(package_dir)
-  LICENSE
d  my
-  setup...

Then you don’t want to re-checkout. The solution is to provide a develop-dir:

>>> write('buildout.cfg','''
... [buildout]
... extensions=gp.svndevelop
... develop=../my.testing
... develop-dir=%s
... parts=
... ''' % os.path.dirname(package_dir))

And run buildout again:

>>> print system(buildout)
Develop: '/...Package/my.testing'

It works fine but now the package in the buildout dir is not used by buildout:

>>> ls(sample_buildout)
-  .installed.cfg
d  bin
-  buildout.cfg
d  develop-eggs
d  eggs
d  my.testing
d  parts

buildout use the one in our develop-dir:

>>> cat(sample_buildout, 'develop-eggs', 'my.testing.egg-link')
/...Package/my.testing
.

Of course you can put the develop-dir option in your ~/.buildout/default.cfg

Cleanup test:

>>> import shutil
>>> shutil.rmtree(os.path.join(sample_buildout, 'my.testing'))

Omit the develop directive

You can omit the develop option and get develop eggs directly from the svn-extend-develop one:

>>> write('buildout.cfg','''
... [buildout]
... extensions=gp.svndevelop
... svn-extend-develop=%s/my.testing/trunk#egg=my.testing
... parts=
... ''' % repository)

This will install the my.testing package as a develop egg:

>>> print system(buildout)
A    my.testing/LICENSE
A    my.testing/my
A    my.testing/my/__init__.py
A    my.testing/my/testing
A    my.testing/my/testing/__init__.py
A    my.testing/my/testing/README.txt
A    my.testing/setup.py
...
Develop: '/...buildout/my.testing'

Auto update develop directories

The extension will update develop directories if they already exist:

>>> rmdir(sample_buildout, 'my.testing', 'my', 'testing')
>>> print system(buildout)
A    ...sample-buildout/my.testing/my/testing
A    ...sample-buildout/my.testing/my/testing/__init__.py
A    ...sample-buildout/my.testing/my/testing/README.txt
...
Develop: '...sample-buildout/my.testing'

Develop eggs from existing parts

Warning, use this option only if you know what you’re doing. I think at this time, I’m the only one to know until you’ve read the code ;)

The extension can scan eggs in parts and set them as develop:

>>> write('buildout.cfg','''
... [buildout]
... extensions=gp.svndevelop
... eggs=my.testing
... scan-eggs=true
... develop-dir=%s
... parts=
... ''' % os.path.dirname(package_dir))

The if you run buildout again, the develop egg is used:

>>> print system(buildout)
Develop: '/...Package/my.testing'

This will not work if a version is specified:

>>> write('buildout.cfg','''
... [buildout]
... extensions=gp.svndevelop
... eggs=my.testing>=01
... scan-eggs=true
... develop-dir=%s
... parts=
... ''' % os.path.dirname(package_dir))
>>> print system(buildout)

If scan-eggs exist, the extension will also try to set your recipes as develop eggs.

Changes

0.3

  • auto update existing develop directories when running buildout [gawel]

0.2

  • force to use package in develop-dir if any [gawel]

  • add svn-extend-develop option [gawel]

  • add scan-eggs option to allow easy develop setting on all eggs found in develop-dir or svn-develop [gawel]

0.1

  • initial version [gawel]

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

gp.svndevelop-0.3.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

gp.svndevelop-0.3-py2.4.egg (10.3 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