News for hackers. Stuff that matters.
Re:Pipenv: promises a lot, delivers very little by greysteil on Wednesday December 05, 2018 @05:10PM (#18613153)
Sometimes, improvements don't happen in a straight line.

There's been a lot of work on Pipenv over the the last 6 months, predominantly by Dan Ryan and Tzu-Ping Chung, and it's getting stronger and stronger with each release.

If you've gone back to using pip I'd encourage you to give Pipenv another try. Introducing a lockfile is a big step forward for Python dependency management, and the team working on Pipenv are committed and doing a great job.

Re:Pipenv: promises a lot, delivers very little by legostormtroopr on Wednesday December 05, 2018 @06:02PM (#18613646)
> Sometimes, improvements don't happen in a straight line.

I don't deny that, what I am (and the article is) saying is that we were sold on Pipenv being "the officially recommended Python packaging tool from Python.org".

And PyPA didn't refute it, and Heroku didn't refute it, so the community bought it.

Yes, introducing a Lockfile is huge, and it was massively needed, and thats why when we were told "heres the official way to do it", we got excited. Then we got daily breaking updates, rude issue close messages, and a giant backtrack of "its free and still under development, why do you expect so much from us?"

Re:Pipenv: promises a lot, delivers very little by emptysea on Wednesday December 05, 2018 @07:29PM (#18614211)
Another reason Heroku didn't refute Pipenv is that Pipenv's creator leads Python related things at Heroku.
Re:Pipenv: promises a lot, delivers very little by warmblanket on Wednesday December 05, 2018 @07:54PM (#18614391)
Not anymore, I don’t believe.
Re:Pipenv: promises a lot, delivers very little by rendaw on Wednesday December 05, 2018 @05:32PM (#18613361)
Pipenv tries to upgrade all the versions of everything in your lockfile whenever you add a new package (not just dependencies of the package), and there's no way to disable this behavior. Right now. That's the tip of the iceberg.
Re:Pipenv: promises a lot, delivers very little by greysteil on Wednesday December 05, 2018 @05:34PM (#18613380)
You might want to check out https://github.com/pypa/pipenv/pull/3304, which Dan is actively working on to solve that.
Re:Pipenv: promises a lot, delivers very little by cellularmitosis on Wednesday December 05, 2018 @08:14PM (#18614512)
Poor control over this sort of behavior makes Cocoapods very frustrating to deal with.
Re:Pipenv: promises a lot, delivers very little by devnonymous on Wednesday December 05, 2018 @05:45PM (#18613485)
> Sometimes, improvements don't happen in a straight line.

I don't think that the parent disagreed with that. The point, as I understood it, was that this beta stage improvement was marketed as being ready. IOW, if pipenv was not Kenneth's project, it likely would have evolved in, to use your phrase, a straighter line.

Re:Pipenv: promises a lot, delivers very little by sprt on Wednesday December 05, 2018 @05:34PM (#18613372)
Pipenv is designed solely for packaging applications, per the maintainers' admission. It's not suited for libraries and is not designed to be. If you want to replace pip, you should have a look at Poetry.
Re:Pipenv: promises a lot, delivers very little by scrollaway on Wednesday December 05, 2018 @05:43PM (#18613467)
> It's not suited for libraries and is not designed to be.

That's kind of the problem. Why on earth are libraries and apps getting a different treatment? The JS ecosystem manages to have one tool for apps and libraries. One too for installing and publishing. All of it with lockfile support, workspace/"virtualenv" support, etc. And somehow, it's not confusing.

Adding one more tool to the stack is a really funky step forward. Yes, it brings lockfiles. Cool, although we already kind of had those (--freeze). Packaging in Python is a mess and I'm more and more in the camp that as long as Pipenv keeps flouting itself as "the better solution", all the while not covering all the basic use cases, we've gone backwards and are in even more of a mess.

Re:Pipenv: promises a lot, delivers very little by gizmo385 on Wednesday December 05, 2018 @06:44PM (#18613942)
And it isn't only Javascript that manages to have a single tool for this. Clojure has a single tool. Java has a single tool. Rust has a single tool.

This is a solved problem across a variety of popular and mainstream programming languages. I don't mean to suggest that the problem isn't complicated, but this isn't a problem that doesn't have a wealth of previously written solutions to look at for inspiration.

Re:Pipenv: promises a lot, delivers very little by bobbyi_settv on Wednesday December 05, 2018 @07:34PM (#18614250)
What's the "one tool" for Java? Is it Maven? Ivy? sbt? Gradle? You may say some of those are "build tools" rather than dependency tools, but I don't see how it's different than what we are discussing in Python.

My Java app declares its dependencies in a build.sbt file using Scala syntax and has them cached in an Ivy directory. Yours declares them in a pom file using XML syntax and has them cached in a Maven directory. Neither of us even tries to do lockfiles and instead just has the CI server build an "uber jar" with all the dependencies bundled in.

Re:Pipenv: promises a lot, delivers very little by EdwardDiego on Thursday December 06, 2018 @02:10AM (#18616031)
We don't need lockfiles in Java land because we generally use version ranges very carefully and rely on package developers following semver - and we certainly don't use "just whatever the latest release is, dude" like shown in the example Pipfile: https://pipenv.readthedocs.io/en/latest/basics/#example-pipf... (the asterisks)

I get why Python needs lockfiles, but goddamn, that need is a symptom of the mess of managing Python dependencies.

There's still a long way to go - I use Airflow for ETL management, and I'm using pipenv to manage it - except Pipenv can't create a lockfile because a dependency of a dependency of Airflow requires in flask-wtf <= 0.7, while another dependency of a dependency requires ==0.8

In a Maven pom.xml I can easily exclude or override the conflicting dependency manually if needed, but I can't in a Pipfile.

Re:Pipenv: promises a lot, delivers very little by icebraining on Thursday December 06, 2018 @02:36AM (#18616128)
rely on package developers following semver

Well, that seems naive. Almost 1/4th of Maven Central libraries broke binary compatibility in patch updates: https://avandeursen.com/2014/10/09/semantic-versioning-in-ma...

Netflix, at least, doesn't agree that Java doesn't need lockfiles: https://github.com/nebula-plugins/gradle-dependency-lock-plu...

Re:Pipenv: promises a lot, delivers very little by ric2b on Thursday December 06, 2018 @07:21AM (#18617357)
> We don't need lockfiles in Java land because we generally use version ranges very carefully

Yes, which is part of the reason why lots of Java projects almost never update their dependencies, because no one remembers why that version was chosen. Splitting what you want from what you have is important to communicate this.

> There's still a long way to go - I use Airflow for ETL management, and I'm using pipenv to manage it - except Pipenv can't create a lockfile because a dependency of a dependency of Airflow requires in flask-wtf <= 0.7, while another dependency of a dependency requires ==0.8

I'm not sure what you expect it would be able to do here...

Re:Pipenv: promises a lot, delivers very little by EdwardDiego on Thursday December 06, 2018 @03:51PM (#18622094)
Enforce Flask-wtf 0.8 and see if it works.
Re:Pipenv: promises a lot, delivers very little by ben-schaaf on Thursday December 06, 2018 @03:11AM (#18616254)
With my very small sample size, maven and gradle's lack of version locking just means it gets tacked on in terrible ways when needed.
Re:Pipenv: promises a lot, delivers very little by allengeorge on Wednesday December 05, 2018 @11:40PM (#18615468)
People use sbt for Java? Thats’s...surprising.

Most shops I know use one of maven or gradle. I can’t think of any other serious contenders in Java (if you still use ant: please consider alternatives).

Re:Pipenv: promises a lot, delivers very little by scrollaway on Wednesday December 05, 2018 @06:56PM (#18614021)
Right, exactly! It bugs me that we have a wealth of examples and could have just said: "Look. Here's yarn. Do that, but for Python. Don't try to be too creative."

Poetry looks like it did just that though and I'm warming up to it at a very high speed.

Re:Pipenv: promises a lot, delivers very little by minikomi on Wednesday December 05, 2018 @09:55PM (#18614970)
Clojure has two tools.. designed to be used as the single tool though.

Boot, and Lein. I'm partial to boot lately.

Re:Pipenv: promises a lot, delivers very little by rtpg on Wednesday December 05, 2018 @09:09PM (#18614775)
libraries and apps _should_ get different treatment. A library often has to coexist with other unknown code (open world assumption), an application you're controlling is effectively existing in one specific universe: the one you define (closed world assumption).

You wouldn't write your application to support 5 versions of Django, but you _probably_ would do so for a library.

That said, I do basically agree about `pip` existing already. We could have built a tool to manipulate `requirements.txt` files instead of introducing another format and a toolchain that is _much_ slower and brittler. Though ultimately at this point Python packaging woes feel like they are at a much lower level (the fact that libraries end up being "installed" mean that preparing all your dependencies to go out to multiple servers is a mess).

Re:Pipenv: promises a lot, delivers very little by IvanAnishchuk on Thursday December 06, 2018 @03:52AM (#18616387)
> We could have built a tool to manipulate `requirements.txt` files

There's pip-compile from https://pypi.org/project/pip-tools/ that does exactly that. Pipenv uses its resolving mechanism if I'm not mistaken. It produces standard req.txt file with versions pinned and supports separate dev requirements. It had some bug with upgrades last time I checked though, not sure whether it's resolved, currently considering using it for projects at work.

Re:Pipenv: promises a lot, delivers very little by SmirkingRevenge on Tuesday December 11, 2018 @05:59PM (#18659791)
Have used pip-tools for a long time... its very uncomplicated and just makes things pretty darn simple.

Since its all just requirements files with pip-tools, its been fairly commitment free, in that I haven't had to substantially rework any major bits of workflow to use it - nor would I to remove it. Not sure I could say the same thing about pipenv and/or poetry.

Re:Pipenv: promises a lot, delivers very little by pseudalopex on Wednesday December 05, 2018 @10:04PM (#18615002)
An internal application can exist in one specific universe. Most of the time.

The "library" workflow works for applications too. Put your direct dependencies in setup.py. Build wheels of everything and upload them to an internal PyPI server. Pin everything in requirements.txt.

Re:Pipenv: promises a lot, delivers very little by pvg on Wednesday December 05, 2018 @09:11PM (#18614784)
Pipenv keeps flouting itself

That would be weird. Perhaps you mean 'flaunting'?

Re:Pipenv: promises a lot, delivers very little by scrollaway on Wednesday December 05, 2018 @10:23PM (#18615095)
Yes, typo :)
Re:Pipenv: promises a lot, delivers very little by GauntletWizard on Thursday December 06, 2018 @01:06AM (#18615805)
I already managed my python deps with a lockfile - requirements.txt and requirements-frozen.txt, which about three lines of shell script took care of for me. From the article, it doesn't sound like pipenv buys me much on top of that.
Re:Pipenv: promises a lot, delivers very little by pas on Thursday December 06, 2018 @12:20PM (#18620005)
It's a "standard" way to do those scripts. It gives you the NodeJS + NPM way's "npm i", by creating a virtualenv and pip installing into it. It helps with specifying prod and dev dependencies too - if I remember correctly.
Re:Pipenv: promises a lot, delivers very little by circles_for-day on Wednesday December 05, 2018 @10:12PM (#18615042)
I just switched away today. It still sucks
Re:Pipenv: promises a lot, delivers very little by weberc2 on Wednesday December 05, 2018 @07:26PM (#18614195)
We’re giving it an honest try, but we still get burned regularly. I’m pretty disappointed.
Re:Pipenv: promises a lot, delivers very little by vmchale on Wednesday December 05, 2018 @11:49PM (#18615497)
> Introducing a lockfile is a big step forward for Python dependency management

Huh? I'm not really familiar with the state of dependency management for Python/dynamic languages but... there's much more out there beyond just lockfiles. I'm a bit appalled Python is so far behind.

Re:Pipenv: promises a lot, delivers very little by IvanAnishchuk on Thursday December 06, 2018 @03:58AM (#18616416)
Much more for what? In this context, "lockfile" means a file listing all your project dependencies with exact versions pinned. (Not semaphore-files or anything like that. It's not even a python-specific term, e.g. npm uses package-lock.json for the same purpose.) The need for something to store all dependencies with exact versions pinned exists in any language and infrastructure, are there any better solutions than store them in a file? Files are nice, they are VCS-friendly and everything.
Re:Pipenv: promises a lot, delivers very little by vmchale on Thursday December 06, 2018 @11:52AM (#18619678)
> Much more for what?

Much more in the field of build tooling/package management. Pinning versions is fine, but dependency resolution is another legitimate choice.