gwk / muck

A build tool for data projects.
49 stars 3 forks source link

Resolve source candidates from project directory, not muck directory #1

Closed gabestein closed 7 years ago

gabestein commented 8 years ago

This might not be the intended Muck usage, but I suspect it will crop up in other use cases.

If I create a project directory inside the muck folder (say, _misc), and try to run python3 muck.py _misc/target.ext, all muck sources in target.ext need to be relative to the muck root directory, rather than the _misc directory.

Put another way, if I have the file _misc/target.ext and it includes something like json = muck.source('db.json'), running python3 muck.py _misc/target.ext will exit with the error: muck error: seed-db.json: no source candidates matching 'seed-db'. This can be resolved by changing the muck source in _misc/target.ext to muck.source('_misc/db.json). But I'm expecting it to know that the root for the project is _misc.

gwk commented 7 years ago

This is the intended behavior. Muck projects are meant to be written with all targets relative to the project root. Yours was an unusual case because you were using a very early version and trying out a first example from within the muck directory; since then muck has become installable and you would do something like cd my-project && muck target.ext.