-
Notifications
You must be signed in to change notification settings - Fork 249
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
Switch to pip python API? #23
Comments
Apparently in 2010 pip was garbage from an API perspective. https://groups.google.com/forum/m/#!topic/python-virtualenv/_VmM-R1Y8pg We could add some cool features though like idempotency (don't install if |
Yes, we could add some new features, but this won't change the fact that 'pip' would not be executed on fedora since it is called 'pip-python' there ... The API is not awesome, but managable: |
I mean these features would be accessible with the api. The command-line is
|
Why is this labeled as a bug? Because it's broken on fedora? |
Is it acceptable if we just scan PATH to decide whether to use |
This ... import pip
pip.main(['install', 'committer']) ... works for me. What do you think about that? |
Haha, ok. Yeah that works for me too. I think it's a bit ridiculous to call the command line entrypoint an "API" but due to the awesome separation of concerns (cough cough) the commands are all aware of the option parser anyway, so... I guess that settles it, I'll implement this tomorrow. Thank you for your guidance! |
Hi @aelgru , can you have a look at my branch? I ask for a review because I'm not overly happy with how it turned out. We need to prevent pip from cluttering up stdout/stderr (imho the contextmanager is the least ugly solution to this) and we need to deal with a possible SystemExit or whatever pip throws at us. I haven't done any refactoring yet (the return codes are a good candidate for instance) because I don't want to do any superfluous work. Do you agree with the solution or should we look into something else like determining the adequate pip script name? |
This is so annoying... 😠 ... looks like we have to write our own package installer. My problem with the script solution: I guess the people who renamed Using the "not existing API" of pip by calling the script entry point What about checking import platform
platform.linux_distribution() ? If we are on a Fedora system we set the name of the script to |
I don't like handling extra cases like that. It usually ends with a clusterf***. For instance look at https://bugzilla.redhat.com/show_bug.cgi?id=958377 . |
Let's accept we learned a lot about pip and Fedora and close the issue. I am sorry for creating this issue at all. |
On some Linux distributions (namely fedora) pip comes as
pip-python
instead ofpip
. see fedoraThe text was updated successfully, but these errors were encountered: