Nobody's done it because any potential solutions are much too brittle. On Debian derivatives, it's not too big a problem, but go outside of that, and even high-level tooling is a mess (the tooling on top of RPM varies from distro to distro, and even version to version). On macOS, if you're using a ports-like system, you might be dealing with fink, MacPorts, brew, pkgsrc, &c.
Any competently-managed project, OTOH, will list the dependencies for a number of major distros and OSs so that the person installing it will have an idea what to look for.
I'm all ears for a reasonable solution to this, if you have one.
I actually started probably the only project to actually make a stab at solving this: https://github.com/unixpackage/unixpackage
However, I'm loath to continue working on it because there are few tasks more tedious, filled with annoying edge cases and thankless than this. Plus I know it would never make it into pip because "it's not pip's job".
>I'm all ears for a reasonable solution to this, if you have one.
The only one I can think of is to packages like libpq-dev and libjpeg-dev and even the C compiler installable via pip and get the maintainers of pillow/psycopg2/whatever else to remove all their horrible hacky code to look for these dependencies on the system itself.
This will balloon the size of virtualenvs and increase installation times but it'll be worth it. Not only will it eliminate those horrible installation errors making everybody happy (not just beginners), it will eliminate a nasty source of brittleness (subtly different behavior caused by different versions of these packages on different platforms).
That, in a nutshell, is the problem.
> Plus I know it would never make it into pip because "it's not pip's job".
There are good reasons it wouldn't make it into pip: something like that is more the realm of setuptools, rather than pip.
> The only one I can think of is to packages like libpq-dev and libjpeg-dev and even the C compiler installable via pip and get the maintainers of pillow/psycopg2/whatever else to remove all their horrible hacky code to look for these dependencies on the system itself.
The 'horrible hacky code' is autotools 90% of the time, and while I'd like to see if die in a fire and for pkgconf to replace it as far as library detection goes, it's not going away any time soon.
Also, there is next to no chance of what you propose happening: you're essentially proposing a parallel system package management system, and at that point you'd might as well just propose that the Python packaging toolchain integrate, I don't know, maybe pkgsrc into itself.
That problem can be solved with money. I've seen Jessica McKellar offer to shower PSF money over people who want to help make installation of python easier for beginners on Windows. I've not seen her offer to shower money over anybody wanting to solve this problem.
And, as I mentioned before I don't believe a solution like that unixpackage would actually make it into pip. They'd refuse it.
That, in the nutshell, is the problem.
>There are good reasons it wouldn't make it into pip: something like that is more the realm of setuptools, rather than pip.
Maybe. I'm never really sure where one ends and the other begins, to be honest. Perhaps that's part of the problem.
>you're essentially proposing a parallel system package management system,
I am, yes. And as ridiculous as that may sound it's utterly crucial.
>and at that point you'd might as well just propose that the Python packaging toolchain integrate, I don't know, maybe pkgsrc into itself.
That would be my other proposal, yes. Either pkgsrc, guix or nix.
>Also, there is next to no chance of what you propose happening
Want to know what's really shit about python?
Have you proposed this to anyone in the PSF?
> Maybe. I'm never really sure where one ends and the other begins, to be honest. Perhaps that's part of the problem.
In a nutshell, leaving out various details: pip downloads packages, asks them for their dependencies, downloads the dependencies, asks them for their dependencies, and so on, and so on. Then it does a topological sort and asks them to install themselves.
The process of installation is done by the setup.py file within the package[1]. That's setuptools.
The line between the two is pretty clear; this is similar to the split between dpkg/apt or rpm/yum, except setuptools itself has some built-in dependency resolution support.
[1] Assuming it's not a wheel.
> I am, yes. And as ridiculous as that may sound it's utterly crucial.
And a security nightmare.
> Want to know what's really shit about python?
Do you know what's shit about dealing with just about every language out there? Pick a language with its own package management, and the moment it steps outside of its own runtime environment, this problem crops up.
Want to know why I think there's little chance of this working? It's nothing to do with Python and everything to do this being a nightmare for sysadmins.
I'm not interested in getting involved in their politics.
>And a security nightmare.
Absurd.
>Do you know what's shit about dealing with just about every language out there?
Not this. You might have noticed a variety of java programmers saying "nope, not an issue here".
>Pick a language with its own package management, and the moment it steps outside of its own runtime environment
The issue is not at all to do with stepping outside of the runtime environment and everything to do with running code in an uncontrolled environment. The solution is to control the environment as much as you can and fail cleanly if you can't.
>Want to know why I think there's little chance of this working?
No, I have no interest in what you think any more.
Then why did you even bring them up?
> Absurd.
Not if you're a sysadmin.
> Not this. You might have noticed a variety of java programmers saying "nope, not an issue here".
Because JNI is barely used. This isn't the case with Python, or Ruby, or a host of other lanuages.
> No, I have no interest in what you think any more.
Don't be an ass.
I've never ever had to think about it with the Java ecosystem. I just get a jar and stuff magically works.
The issue arises when you're calling out to something written in, say, C. You'll have the same pain in java if you start using JNI to call across the JVM boundary. It just crops up more in Python because C extensions get used a lot in Python.
Addendum:
[1] By this, I mean within the boundaries of the runtime environment and not using things like Python's C extension API or JNI. 'Native' is a poor choice of words.
I suppose it could have been a fat-jar thing: if the jar contains its non-java dependencies for my platform, then everything just works. If the native libs are separate, then sure, its a similar issue as described elsewhere here.
You have a similar kind of pain when you have pip and apt trying to manage the system python installation.
This is all about running code in an uncontrolled environment.
So no, there aren't.
Now, I have a project I'd like to try with per-process mounts of dependencies using unionfs. It'd be a lot of work, and a lot could go wrong, but would solve a lot of problems.
Precisely. Virtualenvs solve part of the problem by isolating the python code and its dependencies - but not all of the code.
Apparently extending this behavior would cause security issues of an unknown nature...
Also, what you're proposing boils down to asking them to all standardise on RPM. Have you asked yourself why all these different package management tools exist in the first place?
The problem isn't that this can't be solved in a consistent, clear way. The problem is that nobody views this as their problem to solve.
Would you fault it for those, too? Or would you find a point where you declare "not my problem", and then open yourself up to precisely this same criticism, just with the line drawn in a different place than where it currently is? I'm OK with the fact that the Python package installer installs Python packages. I'm OK with the fact that glancing at the documentation for psycopg immediately tells me up-front in its install instructions the things I'll need.
It also helpfully pre-empts the article here, suggesting a final debugging step for a non-functioning install:
Complain on your blog or on Twitter that psycopg2 is the worst package ever and about the quality time you have wasted figuring out the correct ARCHFLAGS. Especially useful from the Starbucks near you.
Not a dependency.
>doesn't install a TCP/IP stack or any type of socket abstraction for communicating with a Postgres server
Because that's never caused a problem when installing psycopg2, ever.
>doesn't display an interactive SQL tutorial
Not a dependency.
>doesn't install an operating system capable
How exactly would you be running pip without an OS?
>Would you fault it for those, too?
I think you misunderstand what a dependency actually is.