-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Support installing from Git URLs #539
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
Comments
The supported URL scheme is pip install git+https://github.com/pypa/pip.git On 21 May 2012 08:45, anatoly techtonik
|
That's good to know, but as you may see - not everybody is aware. It would be nice to support the HTTPS version too as it is the one proposed by GitHub fopr copy/paste. |
Hello, I submitted #580 to address your issue. Mihnea |
My concern about auto-detecting Otherwise, a URL whose path portion ends with |
I don't quite get the stuff about URLs. To me all URLs can be immutable - it should be enough to calculate some weights based on URL just to sort handlers and try them one by one until a correct one if found. |
I'm not at all convinced that "calculating some weights" and "trying them one by one" is a sane approach for vcs backends, as opposed to having relatively simple documentable rules for how URLs are linked to the appropriate VCS backend. Trying the wrong VCS for a given URL will in some cases result in errors that are quite difficult to distinguish programmatically from things like simple network errors (which is something pip has to deal with often), so the whole thing would be both fragile and slow (if you try a github url and github or your network is down, suddenly pip is trying the same URL with every other VCS backend...). That said, if you want to put together a pull request as proof of concept for this approach, feel free to give it a try and see how it works out. |
The problem is not solvable with static URL rules. Bitbucket (and Mercurial in general) URLs don't contain any repository identification information. RTFM is not a good UX. Besides, handler is not yet a VCS - handler can make a probe for the URL to detect if the URL is actually of its type. The exception in case of broken connection and different exception for wrong repository type covers your user story about fragile errors. Next time I will have problems with pip recognizing Mercurial repo for HTTPS URL I'll try to make some patch. The rule matching is a common pattern though, and I am sure that if not setuptools then other tools might already have it. |
Well then maybe we should just add a helpful message to the error that pip shows when you try to do |
@mihneadb I'd be very happy with a patch to make the error clearer by giving better usage instructions. |
Ok, I'm on it. Thanks for the feedback! Mihnea Dobrescu-Balaur On 19.06.2012, at 09:10, Paul [email protected] wrote:
|
Closing this issue, I agree with others that trying to detect the repository type is a bad path to go down. |
@dstufft Is it still possible to incorporate @pnasrat suggestion of giving better usage instructions. This was non-obvious to us at first when using pip to install pyjs from pypi. |
Sure! Better instructions are always welcome :) |
Detecting repository type is just one extra request. If pip makes it hard to implement maintainable message exchange with two steps, maybe there is a problem in its architecture? |
Just chucking pip a url and "hoping it will figure out what to do with it after trying x different things" is bad, implicit design, and as already suggested it makes useful error reporting insane. Explicitness is better. I think pip already accepts too many valid formats of package requirements using the single command Unfortunately there's obviously backwards compatibility to consider so we don't have license to rewrite things wholesale.
Then that (ideally) should be fixed first, before adding to the problems it causes. Pull requests welcome. |
If the stack traces are reported then this is the ideal situation. We are working on an internal solution. If we have any pull requests we will certainly initiate those in the future. |
The proposed workaround is to detect if failed URLs ends with .git and try to use
git
(or dulwich) to get content from it if everything else fails.The text was updated successfully, but these errors were encountered: