Code Monkey home page Code Monkey logo

Comments (11)

mriehl avatar mriehl commented on May 18, 2024

Apparently in 2010 pip was garbage from an API perspective.
Not sure if it has changed.

https://groups.google.com/forum/m/#!topic/python-virtualenv/_VmM-R1Y8pg

We could add some cool features though like idempotency (don't install if
dependency is there and the upgrade option is disabled, etc).

from pybuilder.

aelgru avatar aelgru commented on May 18, 2024

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:
https://github.com/pypa/pip/tree/develop/pip/commands

from pybuilder.

mriehl avatar mriehl commented on May 18, 2024

I mean these features would be accessible with the api. The command-line is
kinda limited.
On 21 Nov 2013 22:24, "Michael Gruber" [email protected] wrote:

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:
https://github.com/pypa/pip/tree/develop/pip/commands


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-29025841
.

from pybuilder.

mriehl avatar mriehl commented on May 18, 2024

Why is this labeled as a bug? Because it's broken on fedora?

from pybuilder.

mriehl avatar mriehl commented on May 18, 2024

Is it acceptable if we just scan PATH to decide whether to use pip-python or pip?
I just played around with the pip "API" and the InstallCommand wants an option parser as argument. I am not working with that kind of API.

from pybuilder.

aelgru avatar aelgru commented on May 18, 2024

This ...

import pip
pip.main(['install', 'committer'])

... works for me. What do you think about that?

from pybuilder.

mriehl avatar mriehl commented on May 18, 2024

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!

from pybuilder.

mriehl avatar mriehl commented on May 18, 2024

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?

from pybuilder.

aelgru avatar aelgru commented on May 18, 2024

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 pip to pip-python on Fedora systems had their reasons for doing that. There might be something else already called pip. Detecting the right executable might not be straight forward too.

Using the "not existing API" of pip by calling the script entry point pip.main might end up in an disaster too since there is no guarantee the this does not change ... since it is not an API.

What about checking

import platform
platform.linux_distribution()

?

If we are on a Fedora system we set the name of the script to pip-python ...

from pybuilder.

mriehl avatar mriehl commented on May 18, 2024

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 .
Starting with fedora 17, it's pip instead of pip-python again. So we have to check for fedora + for the fedora version, and decide from there.

from pybuilder.

aelgru avatar aelgru commented on May 18, 2024

Let's accept we learned a lot about pip and Fedora and close the issue. I am sorry for creating this issue at all.

from pybuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.