mitsuhiko / pipsi

pip script installer
Other
2k stars 133 forks source link

Allow installation from source #174

Open varac opened 6 years ago

varac commented 6 years ago

I'd like to be able to install latest master from a git repo, i.e.

pipsi install git+https://github.com/0k/shyaml

Would this be possible to implement ?

sersorrel commented 6 years ago

That should work already, I think.

varac commented 5 years ago
⏻  ~  » pipsi install git+https://github.com/0k/shyaml
Usage: pipsi install [OPTIONS] PACKAGE

Error: When installing from URLs you need to add an egg at the end.  For instance git+https://.../#egg=Foo

Maybe it works but I don't know how to do it. Can you pls provide an example ? At least the instructions/workflow are not user friendly:

you need to add an egg at the end

How would I know what egg I need (and why?) ?

sersorrel commented 5 years ago

This is described in the Pip documentation:

The "project name" component of the url suffix "egg=-" is used by pip in its dependency logic to identify the project prior to pip downloading and analyzing the metadata.

tldr: add #egg=shyaml to the end of your URL.

Pipsi is enforcing this here:

https://github.com/mitsuhiko/pipsi/blob/b43229d8a3da64bc929e05d0735a17a9a3911d11/pipsi/__init__.py#L223-L226

but perhaps it should be left to Pip.

cs01 commented 5 years ago

I recently started a project called pipx that combines pipsi's functionality with npx's. You can install packages from git projects without the egg suffix.

>> pipx install --spec git+https://github.com/ambv/black.git black
black from package black is now available globally
blackd from package black is now available globally
done! ✨ 🌟 ✨

Would love to hear what you think! https://github.com/cs01/pipx