mr.developer icon indicating copy to clipboard operation
mr.developer copied to clipboard

Suggestion: add referencable options for source paths

Open timmolendijk opened this issue 13 years ago • 0 comments

I have a buildout like the following:

[buildout]
extension = mr.developer
parts = mypart

[sources]
mypkg = git ...
...

[mypart]
imgpath = ${buildout:directory}/src/mypkg/media/img

...

The problem with references like the one under mypart is that it assumes that the repository has been checked out by mr.developer. Imagine extending this buildout configuration to do a development buildout in which an existing local copy of mypkg should be used -- like so:

[sources]
mypkg = fs mypkg full-path=/my/dev/repositories/mypkg

It will break the reference under mypart; not good. In fact I have been using references like {buildout:directory}/src/mypkg so frequently that I introduced a work-around as follows:

[buildout]
extension = mr.developer
sources-dir = src
parts = mypart

[sources]
mypkg = git ...
...
[source-paths]
mypkg = ${buildout:directory}/${buildout:sources-dir}/mypkg
...

[mypart]
imgpath = ${source-paths:mypkg}/media/img

...

This allows for extensions like this:

[sources]
mypkg = fs mypkg full-path=${source-paths:mypkg}
[source-paths]
mypkg = /my/dev/repositories/mypkg

I am suggesting that the paths in source-paths are provided by mr.developer out of the box, as it is relevant information contained and managed by mr.developer. For example, the options under sources could be expanded by mr.developer upon buildout, so that you can do: ${sources:mypkg.path} (and ${sources:mypkg.kind}, ${sources:mypkg.url}).

timmolendijk avatar Mar 05 '11 21:03 timmolendijk