Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages in a subdirectory of a repository #120

Open
wichert opened this issue Jul 10, 2013 · 8 comments
Open

Packages in a subdirectory of a repository #120

wichert opened this issue Jul 10, 2013 · 8 comments

Comments

@wichert
Copy link

wichert commented Jul 10, 2013

I have a couple of packages that are located in a subdirectory of a repository. This makes it impossible to use them with mr.developer. To support this I suggest adding a source_path option, to be used like this:

[sources]
my.package = git [email protected]:path/repo.git source_path=python/my.package
other.package = git [email protected]:path/otherrepo.git source_path=python/other.package
@fschulze
Copy link
Owner

Isn't the "path" option described under "Common options" in the readme what you need? It would look like this:
[sources]
my.package = git [email protected]:path/repo.git path=python
other.package = git [email protected]:path/repo.git path=python

Though I would suggest to use an absolute path with path=${buildout:directory}/python

@wichert
Copy link
Author

wichert commented Jul 21, 2013

The documentation says path is specifies where to make a checkout/clone. What I need is to specify the path inside the repository which is used by buildout to find package sources.

@fschulze
Copy link
Owner

Ah, you have several packages in the same repo, I misunderstood that. Try this:
[sources]
repo = git [email protected]:path/repo.git egg=false
my.package = fs my.package path=${buildout:directory}/src/repo
other.package = fs other.package path=${buildout:directory}/src/repo

Supporting it directly would be pretty complicated. If you would specify different branches, but the same repository we wouldn't be able to share the repo and would need multiple checkouts etc. Actually if that's fine, then being able to specify the package root would be useful for some repositories.

@wichert
Copy link
Author

wichert commented Jul 22, 2013

Not quite: I have a single package in the repository, but it is not located at the root of the repository. The directory structure looks a bit like this:

- Makefile
- README.md
- app/setup.py
- app/src/...
- Prototype/...
- <other folders>

When checking this out buildout needs to be pointed to src/<repo name>/app. Based on your comment I gather this is the workaround:

[sources]
repo = git [email protected]:path/repo.git egg=false
my.package = fs my.package path=${buildout:directory}/src/repo/app

which is not as simple or intuitive as the source_path option I suggested.

@fschulze
Copy link
Owner

I think a better name for that would be package_root and I agree that it is useful. But it would be for one package per checkout:
[sources]
other.package = git [email protected]:path/repo.git package_root=app

@wichert
Copy link
Author

wichert commented Jul 22, 2013

One package per checkout is all I need :)

@fschulze
Copy link
Owner

Or actually just root:
[sources]
other.package = git [email protected]:path/repo.git root=app

@mizi
Copy link

mizi commented May 13, 2015

I noticed that the solution provided by fschulze fails the first time you run buildout with the following message:

INFO: Queued 'repo' for checkout.
ERROR: Directory for package 'my.package' doesn't exist.
INFO: Cloned 'repo' with git.
ERROR: There have been errors, see messages above.

An ugly solution to this problem is to run develop checkout repo before running buildout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants