kdeldycke/mail-deduplicate

add pip to pyproject.toml?

leggewie opened this issue · 6 comments

As you know, I am running bionic. pip3 there is version 9.0.1. When verifying my bionic branch I ran into a problem installing 2 packages via "poetry install" (one of them being regex, I believe). The error message was to the effect that the corresponding wheel was in the wrong format and not supported on my platform. Via google I ended up (where else?) on stackoverflow where I learned that one possible root cause is an outdated pip3 and version 9 is certainly rusty. I've already installed version 20 in my user's directory, but I called poetry in a venv and apparently by default that calls the pip installed from bionic. One pip3 install --update pip inside the venv later and things went their merry way.

Question: With pip being special and all, I wonder if a versioned dependency on pip should be added to pyproject.toml.

Thanks @leggewie for providing the detailed context.

You're right about pip being special. If it is the go-to solution to install packages in the Python ecosystem, it was not always the case. And might not be in the future. Adding pip is going to forces onto the user the choice of package manager. People gets very opinionated about package managers, and there are some alternatives out there: Conda, pipx, apt, ...

So unless we call code or functions implemented in pip, the Python package, there is no need to add pip as a direct dependency to our project.

That being said, we can still amend the documentation and installation instruction to provide guidance to new users on how to install the project in a particular environment (Bionic in your case).

Somehow, I don't like the idea of pushing this out to documentation. I'm sure there is a way within this project or possibly poetry to make the problem transparent to the user or throw a more meaningful error.

I am a seasoned debian/ubuntu admin and package maintainer with decades of experience, but my python foo is a bit more recent than that. If there is more than one python package manager (akin to apt/aptitude/dpkg/yum/dnf), I'd like to find out where the difference is in pip v9 vs v20 that triggers this problem.

gosh, poetry has almost 200 open PRs and several pages of open bugs with the word platform.

Yes, very overwhelming indeed. Referencing this bug that appears to be most closely related (I really have no idea ATM, though).

Again, I am not so well-versed with how python packages stuff. Is it possible for poetry to say that they need at least a certain version of pip? IOW, declare a versioned compile-time dependency? How about specifying alternative dependencies?

In Debian (are you on Debian, respectively a derivative?), I would specify "Depends: pip >= 123 | conda | pipx >= 345" in the debian/control file to solve this problem.

It turns out that I was using poetry the wrong way, apparently, by creating a venv, installing it there, activating the venv and then running poetry from the venv. Apparently, that's a no-no. I did this so as not to mess up the python packages installed via apt to /usr/lib/python3 and pip to ~/.local/ That's enough of a mess to deal with by itself.

Closing as invalid.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.