peru icon indicating copy to clipboard operation
peru copied to clipboard

include peru's dependencies in the repo

Open benjamin-bergia opened this issue 10 years ago • 5 comments

Is there a way to directly include Peru in a repository? Kind of like Rebar. This way after cloning the repository, peru is directly available without having to install it through pip.

benjamin-bergia avatar Feb 03 '15 08:02 benjamin-bergia

Yes, you could check in the peru repo as a subdirectory of your project. The peru.py script at the root of the repo should work to run peru from there, though it expects peru's dependencies to be available (see setup.py, but mainly Docopt and PyYAML). You could check those in too, and then use a wrapper script of your own that puts your local copies of them in the PYTHONPATH before invoking peru.py.

That's a little hacky, and unfortunately it won't be super stable if we add more dependencies to future versions of peru, but let me know if you think it might work for you. Previously we had an approach where we would check in copies of our dependencies for peru.py, but that got annoying when we started supporting setup.py too, and we had to update dependencies in two places. If this was a common use case, though, I could see us switching to a model where we check in peru.docopt and peru.yaml and stop using setup.py for dependencies at all. @olson-sean-k what do you think?

oconnor663 avatar Feb 03 '15 18:02 oconnor663

I put up a branch to try this out: https://github.com/oconnor663/peru/tree/third_party

oconnor663 avatar Feb 08 '15 09:02 oconnor663

I think I like this. setup.py still has our Python 3.3 dependencies (asyncio and pathlib, both provided by default in Python 3.4), so pip install still works there, but in Python 3.4 there are no external dependencies, and running peru.py straight out of the repo works. We also get to have peru be self-bootstrapping again, which makes me smile. (I think the script we had before, which confirmed the contents of third_party matched what was in peru.yaml, was more trouble than it was worth. I don't plan to bring it back.)

oconnor663 avatar Feb 09 '15 00:02 oconnor663

That exactly what I was looking for :+1: Thanks

benjamin-bergia avatar Feb 25 '15 09:02 benjamin-bergia

@olson-sean-k and I have gone back and forth on this. On the one hand it's a nice capability to have. On the other hand, it makes our dependency management pretty nonstandard for a Python project. On the other other hand, it's would be cool to have peru bootstrap itself. On the other other other hand, if we ever take a dependency on libgit2, it probably won't work to check peru into your repo anymore. Not sure.

oconnor663 avatar Mar 06 '15 04:03 oconnor663