Skip to main content

A zc.buildout extension to ease the development of large projects with lots of packages.

Project description

Introduction

http://www.netsight.co.uk/junk/xkcd-buildout.png

Let Mr. Developer help you win the everlasting buildout battle!

(Remixed by Matt Hamilton, original from http://xkcd.com/303)

mr.developer is a zc.buildout extension which makes it easier to work with buildouts containing lots of packages of which you only want to develop some. The basic idea for this comes from Wichert Akkerman’s plonenext effort.

Usage

You add mr.developer to the extensions option of your [buildout] section. Then you can add the following options to your [buildout] section:

sources-dir

This specifies the default directory where your development packages will be placed. Defaults to src.

sources

This specifies the name of a section which lists the repository information of your packages. Defaults to sources.

auto-checkout

This specifies the names of packages which should be checked out during buildout, packages already checked out are skipped. You can use * as a wild card for all packages in sources.

The format of the section with the repository information is:

<name> = <kind> <url> [path] [key=value]

The different parts have the following meaning:

<name>

This is the package name.

<kind>

The kind of repository. Currently supported are one of svn, hg, git or fs.

<url>

The location of the repository. This value is specific to the version control system used.

[path]

The (optional) base directory where the package will be checked out.

The name of the package will be appended.

If it’s not set, then sources-dir will be used.

[key=value]

You can add options with this, which are specific to the version control system used. There are is no whitespace allowed in key, value or around the equal sign.

The different repository kinds accept some specific options.

svn

The <url> is one of the urls supported by subversion.

You can specify a url with a revision pin, like http://example.com/trunk@123.

You can also set the rev or revision option, which is either a pin like with rev=123 or a minimum revision like rev=>123 or rev=>=123. When you set a minimum revision, the repository is updated when the current revision is lower.

git

Currently no additional options.

hg

Currently no additional options.

fs

This allows you to add packages on the filesystem without a version control system, or with an unsupported one. You can activate and deactivate packages, but you don’t get status info and can’t update etc.

The <url> needs to be the same as the <name> of the package.

The following is an example of how your buildout.cfg may look like:

[buildout]
...
extensions = mr.developer
sources = sources
auto-checkout = my.package

[sources]
my.package = svn http://example.com/svn/my.package/trunk
some.other.package = git git://example.com/git/some.other.package.git

When you run buildout, you will get a script at bin/develop in your buildout directory. With that script you can perform various actions on the packages, like checking out the source code, without the need to know where the repository is located.

For help on what the script can do, run bin/develop help.

If you checked out the source code of a package, you need run buildout again. The package will automatically be marked as an develop egg and, if it’s listed in the section specified by the versions option in the [buildout] section, the version will be cleared, so the develop egg will actually be used. You can control the list of develop eggs explicitely with the activate and deactivate commands of bin/develop.

Troubleshooting

Dirty SVN

You get an error like:

ERROR: Can't switch package 'foo' from 'https://example.com/svn/foo/trunk/', because it's dirty.

If you have not modified the package files under src/foo, then you can check what’s going on with status -v. One common cause is a *.egg-info folder which gets generated every time you run buildout and this shows up as an untracked item in svn status.

You should add .egg-info to your global Subversion ignores in ~/.subversion/config, like this:

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store *.egg-info

HTTPS certificates

The best way to handle https certificates at the moment, is to accept them permanently when checking out the source manually.

Changelog

1.4 - 2009-11-16

  • Allow to set a minimal revision for svn repositories. If the current revision is lower, then the package is updated. [fschulze]

1.3 - 2009-11-15

  • Read the cfg used by last buildout run. This prevents unexpected behaviour, if you change mr.developer options like source declarations and don’t run buildout. Such changes are now picked up immediately. [fschulze]

  • Added tests and a buildout to run them easily. [fschulze]

1.2 - 2009-11-12

  • If a package is removed from auto-checkout and wasn’t explicitly activated, then it will be removed from the develop packages automatically. In existing buildouts with an older mr.developer, you have to reset the packages first. [fschulze]

  • Added * wild card support for auto-checkout. [fschulze]

  • Don’t bail on subversion URLs ending in a slash or a revision marker. [fschulze]

  • Removed old way of specifying sources with sources-svn and sources-git. [fschulze]

  • Exit immediately when there are issues during checkout when running as extension. [fschulze]

  • Use verbosity from buildout when running as extension. [fschulze]

  • Fix buildout_dir in develop script, so it is properly escaped on Windows. [fschulze]

  • Changed the output of list -s to match the one from status. [fschulze]

  • Added troubleshooting section to readme. [miohtama, fschulze]

  • All commands have a -h and --help option now to show their help. [fschulze]

1.1 - 2009-08-07

  • Use relative paths from the buildout directory for the develop option if possible. This fixes issues if your buildout path contains a space. [fschulze]

  • Warn when trying to activate or deactivate a package which isn’t checked out. [fschulze]

  • Don’t depend on elementree on Python >= 2.5, because it’s builtin there. [fschulze]

  • When checking out a source it will automatically be activated. [fschulze]

  • Use ‘sources’ as the default section name for source information. [fschulze]

  • Added support for filesystem packages without version control with the ‘fs’ type. [fschulze]

1.0.1 - 2009-05-05

  • Fixed case sensitivity of package names for several commands. [fschulze]

  • SVN externals no longer cause a modified status. [fschulze]

1.0 - 2009-05-02

  • Added info command to print various informations about packages. [fschulze]

  • Added reset command to reset the develop state of packages. This is useful when switching to a new buildout configuration. During the next buildout run the develop state is determined the same way as in a clean buildout. [fschulze]

  • Got rid of deprecation warning in Python 2.6 by removing unnecessary call of __init__ in working copy implementations. [fschulze]

0.15 - 2009-04-17

  • Added reminder to run buildout after activating or deactivating packages. [fschulze]

  • Added rebuild command to rerun buildout with the last used arguments. [fschulze]

0.14 - 2009-04-16

  • Fixed verbose output of checkout command. [fschulze]

  • Added -f option to update command to force updates even if the working copy is dirty. [fschulze]

0.13 - 2009-04-14

  • Added -a option to update command to only update the packages declared in the auto-checkout list. [fschulze]

  • Added activate and deactivate commands. This allows to select which packages are added to the develop option of zc.buildout. Enhanced the status command to show the additional informations. [fschulze]

  • Switched the meaning of ~ and C in status command. [fschulze]

0.12 - 2009-04-14

  • Added support for Mercurial (hg). [mj]

  • Refactored working copy logic, so it’s easier to add support for other version control systems. [fschulze]

  • Added verbose flag to checkout and update commands. [fschulze]

0.11 - 2009-04-06

  • Removed the nice os.path.relpath usage, because it’s only been introduced with Python 2.6. [fschulze]

0.10 - 2009-04-06

  • Added verbose flag to status command. [fschulze]

  • Deprecated sources-svn and sources-git in favour of just sources which allows more flexibility. [fschulze]

  • Changed status command to only check known paths and not the whole sources-dir path. [fschulze]

  • Add possibility to filter packages in update and status commands. [fschulze]

  • Tell the user at the end of the buildout run whether there have been any errors during automatic checkout. [fschulze]

  • Install the develop script as the first part instead of the last, so it can be used to fix problems. [fschulze]

0.9 - 2009-03-30

  • When installed as just an egg, then the resulting develop script can be called from anywhere and will try to find the correct develop script from the current working directory and execute it. [fschulze]

  • Fixed help text formatting. [fschulze]

0.8 - 2009-03-25

  • Added authentication support to subversion commands. [fschulze]

  • Added -a option to checkout command to limit matching to the packages declared by the auto-checkout option. If no further argument is given, then all the packages from auto-checkout are processed. [fschulze]

0.7 - 2009-03-24

  • Added update command to checkout script. [fschulze]

  • Added status command to checkout script. [fschulze]

  • Added status flag to list command to indicate packages with wrong URL. [fschulze]

  • If the working copy is clean, then checkout automatically switches svn packages. [fschulze]

  • Skip on checkout errors during buildout, so the develop script is generated and you get a chance to inspect and fix the problems. [fschulze]

  • Check remote url and stop checkout if it differs. [fschulze]

  • Added various options to the list command. [fschulze]

  • Instead of the checkout script, there is now a develop script with various commands. [fschulze]

0.6 - 2009-03-24

  • Added custom logging formatter for nicer output in the checkout script. [fschulze]

  • Removed the ‘-e’ option, regular expression matching is the default now. [fschulze]

  • Made it possible to specify more than one regular expression without the need to use a pipe symbol and quotes. [fschulze]

  • Added help text for the checkout script to pypi page. [fschulze]

  • Add a warning to rerun buildout after checkout. [fschulze]

0.5 - 2009-03-23

  • Make sure that the updated versions are actually used. [fschulze]

0.4 - 2009-03-22

  • Fixed logging, which fixes the info message output. [fschulze]

  • Skip checkout of existing packages. [fschulze]

0.3 - 2009-03-22

  • Fixed source distribution by adding a MANIFEST.in. [fschulze]

  • Added -e and -l options to checkout script. [fschulze]

0.2 - 2009-03-22

  • Added auto-checkout option (only works with subversion at the moment). [fschulze]

  • Added support for git. [fschulze]

  • Throw error when trying to checkout unknown package. [fschulze]

  • Fixed target directory for checkouts. [fschulze]

0.1 - 2009-03-19

  • Initial release

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

mr.developer-1.4.zip (35.8 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