Compare to a jvm uberjar.
Zip it all up and then deploy with `pip install --no-index --find-links=/path/to/wheels -r pinned-requirements.txt`. Et voila! Binary artifacts that don't suddenly break because PyPI goes down or a package maintainer uploads a new version that unexpectedly deprecates an API that you're using.
a) A 30 sec - 10 minute process to build (vs 0 in python)
b) Weird because Java has a fatjar concept.
Python and Java are different. The easy path to deploy them doesn't need to be the same.
You may need to make them the same for ops sanity.. but if you are just doing 1 or the other, meh
Have you ever run someone else's python code? You have the exact same issue pulling down their requirements.txt, which is often not enough because you need to apt-get other libraries, try pip again, apt-get more, try pip again, etc.
> b) Weird because Java has a fatjar concept.
Sure, that's what you would do if you wanted to deploy an application to proc, my point was that it supports the same git checkout workflow if you want it to, which can be useful when dealing with other people's code and you want to make changes and not just run whatever jar they made.
...but, the deployment is a single artifact.
I don't think doing a git clone, followed by a pip install and waiting for all the dependencies to download... and compile... (or not, if you have the wrong system packages installed) really compares.
If you are doing a blue/green type deploy.. you are basically building up a new VM to be your new environment. It can do all kinds of download and compile type stuff. Who cares if some is pip installing?
"How do I make an exe" with my PyQT app is still a very hard question to answer.
Web deployment is still hard in Python because of lack of general hosting support if you don't own your server.
The situation is way better, and I'm very glad of the work done, but it has still a long way to go.
Does conventional shared hosting actually matter anymore, for application developers as opposed to someone just running a WordPress site? Virtual private servers are just as cheap now.
GAE? PythonAnywhere? Heroku? OpenShift? Docker-based stuff? https://wiki.python.org/moin/SpecializedCommercialHosts maybe? https://wiki.python.org/moin/OtherCommercialHosts if that wasn't enough?
An even simpler way to think about it - imagine you just invented python and are designing the tooling around dependency management and packaging. Would you come up with 'environments'?
What? No, they don't. Typical Java apps are deployed on systems that don't even have Maven installed. Typical Java apps are executed with a classpath argument pointing to the libraries installed for the application. What are the directories containing those JARs (or an uberjar) except an "environment?"
Hell, the Java classloader interacts with the classpath in pretty much the exact same way that the Python interpreter interacts with a virtualenv.
Maven and co.
> Suppose for example that I want to upgrade a package and all packages that it depends on, how would that be done?
Change the version number in pom.xml/build.sbt/build.gradle. Done.
> Or suppose I have different environments a project can be run in that should load slightly different set of dependencies?
Define a new project that depends on your main project and the extra dependencies.
Yes, pip, since before bundler existed.
> Suppose for example that I want to upgrade a package and all packages that it depends on, how would that be done?
pip install --upgrade package
> suppose I have different environments a project can be run in that should load slightly different set of dependencies?
venv activate myproject
I've run into bugs where someone ripped a library out of requirements.txt because they thought it wasn't being used any longer. Turns out it was still being used, but the dev couldn't tell because the lib was still in their venv. Tools like Bundler will actually take the dependency away from you.
Python's packaging system is great compared to C, but it's primitive compared to Ruby, Haskell, Clojure, and lots of others.