152 points · by dsr12 · 9y ago · 46 comments
I have wasted far too much time wrangling pythons packaging systems. Incompatibilities between pip, setuputils, distutils, virtualenv, eggs, C modules, and wheels I have literally given up. I love and use python but I no longer package it and deploy it for others to consume. Try to package a protobuf3/grpc system these days into a .deb, its a nightmare. Even the grpcio devs use docker containers to build packages because python has such a nightmare of a system.
I'll leave the second reason out for the sake of context
It's not the first time I say this, but I think it's crazy how long some package ecosystems live without a "sane" package manager, and how recently those even appeared.
https://docs.pipenv.org/basics.html#specifying-versions-of-p...
pipenv --python python34[1]: You put the third party code in /usr/local/lib/pythonX.Y/site-packages.
We knew[1] it was wrong in the 1990s, but /usr/local is a "best practice", and these people who believe "best practices" are more important than solid engineering breed faster.
Camacho for president 2020.
[1] http://www.alice.org [2] https://en.m.wikipedia.org/wiki/Alice_(software)
Can you provide examples of different ecosystems that would compare favorably in your opinion?
It's not enforced by policies, the tooling isn't much more helpful than in any other language, and it is not more mature than any widely used ecosystem. It feels like Haskell libraries just need less changes.
Note that if you don’t have if __name__ == '__main__',
the code won’t run anything since the function is
initialized but not executed
Isn't this backwards? That test isn't required to make the code run, it prevents the code from running if the file is imported as a module.You don't even need that. The Files[1] class - which has been in the standard library since at least Java 7 - makes this really easy to do.
[1] https://docs.oracle.com/javase/8/docs/api/java/nio/file/File...
with open('alice.txt') as inp, open('new_alice.txt', 'w') as out:
out.write('\n'.join([line.rstrip().replace('Alice', 'Dora the Explorer') for line in inp]))
The author's point is that Java is verbose and requires a lot of boilerplate, which has benefits and drawbacks. I think her example does a decent job of illustrating that.