News for hackers. Stuff that matters.
Re:Guido van Rossum joins Microsoft by kitanata on Thursday November 12, 2020 @12:36PM (#25072276)
We use poetry for apps in production. At this point I think that's the winning solution and as it continues to grow and improve I think it will overtake all the others in this respect.
Re:Guido van Rossum joins Microsoft by derefr on Thursday November 12, 2020 @01:01PM (#25072630)
People keep saying that about every new solution. But then another one comes along that's even better-er, and the previous one peters out.

The biggest need for a package manager and its ecosystem is continuity: the stance that new features and paradigms will be gradually shifted toward — without package-ecosystem incompatibilities, without CLI commands just disappearing (but instead, with long deprecation timelines), etc.

In other words, an officially-blessed package manager is one where, when something better-er comes along, it gets absorbed by the existing thing, instead of replacing it.

That is what the Python ecosystem is missing.

Re:Guido van Rossum joins Microsoft by throwaway894345 on Thursday November 12, 2020 @01:24PM (#25072933)
I don’t think it’s that another one comes along that’s better as much as it is the new “better” ends up missing some important corner case. Pipenv advertised itself as solving all problems, but once someone tries it in practice, they realize that it introduces a new problem: every little interaction takes literally 30 minutes for any non-toy project. I’ve heard mixed things about poetry, but I wouldn’t be surprised in the least of it failed to behave as advertised just because this has been my experience with every package manager I’ve tried to use. And it’s embarrassing when every other language has a package manager that just works.

EDIT: It was probably misleading to characterize Pipenv as advertising itself as solving all problems; it’s probably more correct to say that it’s significant weaknesses weren’t advertised and thus one has to invest considerably before discovering them for oneself.

Re:Guido van Rossum joins Microsoft by memco on Thursday November 12, 2020 @01:51PM (#25073328)
Just a heads up to anyone who hasn’t looked recently: pipenv has been very actively worked on since earlier this year and has had four updates that fix a lot of issues. Earlier this year I would have said Poetry is better hands down, but after the updates and after using poetry and seeing some of its quirks, it’s a much closer matchup.
Re:Guido van Rossum joins Microsoft by ifore on Thursday November 12, 2020 @04:55PM (#25075625)
If it wasn't so opinionated it might have been more successful.

Just one example: you want your virtualenvs to be created in ~/.virtualenvs so that pipenv is a drop-in replacement for virtualenvwrapper+pip? Tough luck for you, Kenneth Reitz doesn't think that's how it should be done.

At least 3 or 4 times some issue I've wanted resolved I found in the issue tracker with the last message "we'll have to check with kennethreitz42 whether we're allowed to change that" and then silence for a year.

It could still catch up with poetry, but from what I've seen there's a fundamental mindset difference in how change requests are approached between pipenv and poetry.

Re:Guido van Rossum joins Microsoft by dagw on Friday November 13, 2020 @05:31AM (#25080933)
Last I checked (3-4 month ago) Pipenv only cares about the situation when you are deploying code on machines (or containers) you have complete control over. If you're writing code for deploying on machines you don't have control over, via for example pip install, then pipenv isn't helpful while poetry supports this out of the box.
Re:Guido van Rossum joins Microsoft by michaelmior on Thursday November 12, 2020 @04:10PM (#25075101)
Interesting. I haven't used pipenv on any very large projects, but I'm surprised to hear about the slowness. With the (admittedly small) projects I've tried it, I found that it does more or less just work.
Re:Guido van Rossum joins Microsoft by throwaway894345 on Thursday November 12, 2020 @04:50PM (#25075565)
As I understand it, the problem is that Pipenv needs to resolve the dependency tree to do just about anything; however, the dependency tree is dynamic—to determine a package’s dependencies, you have to download the package and run it’s setup.py. To get the whole tree, you have to recursively download and run each package. So the cost is proportional to the size of the dependency tree, so it’s very plausible that it works fine for the smallest projects.
Re:Guido van Rossum joins Microsoft by lmm on Friday November 13, 2020 @01:34AM (#25079604)
> The biggest need for a package manager and its ecosystem is continuity: the stance that new features and paradigms will be gradually shifted toward — without package-ecosystem incompatibilities, without CLI commands just disappearing (but instead, with long deprecation timelines), etc.

I disagree. I used to think that that's the problem, but having seen a few more cycles of it, the problem isn't that kind of commitment - after all, the whole python ecosystem enthusiastically jumps into the new thing, and Python people are used to relatively short deprecation cycles. The problems are the actual problems; every Python package manager is just embarrassingly awfully bad as soon as you try to use it for 5 minutes, presumably because they're developed by Python people who've never used a decent package manager and so think that no-one could ever need deterministic dependency resolution, once you've pinned a transitive dependency there surely wouldn't be any reason to ever want to unpin it, having the package manager coupled to the language version is absolutely fine, no-one could ever want a standard way to run tests ...

Re:Guido van Rossum joins Microsoft by solidasparagus on Thursday November 12, 2020 @06:48PM (#25076936)
What the Python ecosystem actually needs is a single opinionated perspective on versioning that is followed by everyone, such as NPM's semantic versioning. In the absence of that I don't see how dependency resolution and thus packaging is ever going to improve in Python.
Re:Guido van Rossum joins Microsoft by JAlexoid on Friday November 13, 2020 @01:55AM (#25079720)
Guido is very opinionated...

He just doesn't care about package management.

Re:Guido van Rossum joins Microsoft by DangitBobby on Thursday November 12, 2020 @01:05PM (#25072680)
Yes, Poetry should be the blessed package manager.
Re:Guido van Rossum joins Microsoft by mumblemumble on Thursday November 12, 2020 @01:15PM (#25072811)
I only want Poetry to become the be-all-end-all of package managers if it turns out that Python really is never going to fix the core problems that have engendered so many of the hacks upon which Poetry (and its competitors) is precariously balanced. Pyenv and venv, for example.
Re:Guido van Rossum joins Microsoft by bshanks on Thursday November 12, 2020 @03:43PM (#25074712)
If you were doing a green field redesign, how would you want Python to fix the core problems?
Re:Guido van Rossum joins Microsoft by dragonwriter on Thursday November 12, 2020 @05:39PM (#25076175)
> Yes, Poetry should be the blessed package manager.

Last time I tried to use poetry (and this is why it was the last time I tried to use poetry), it ignored global pip settings and had no documented mechanism for its own settings (I believe poetry uses its own implementation of or captive install of pip) which made it completely unusable in a corporate environment with annoying SSL interception issues to work around where pip + venv worked.

Poetry is a much smoother experience when it works, though.

Re:Guido van Rossum joins Microsoft by DangitBobby on Sunday November 15, 2020 @02:46AM (#25099153)
It will install a virtual env if you don't have one active and it will use the active one if you do. What global pip settings, for example?
Re:Guido van Rossum joins Microsoft by kavalg on Friday November 13, 2020 @02:30AM (#25079921)
Although I generally like it, the two major issues I have with poetry are the abysmal dependency resolution times and the handling of binary wheels.
Re:Guido van Rossum joins Microsoft by croh on Thursday November 12, 2020 @01:50PM (#25073317)
> People keep saying that about every new solution. But then another one comes along that's even better-er, and the previous one peters out.

I think this is happening these days frequently. People try to cover all use cases and then end up in biting more than they can chew. It won't work that way. Good set of MINIMALS, is easy to maintain, sustain and extend.

Re:Guido van Rossum joins Microsoft by roseway4 on Thursday November 12, 2020 @01:10PM (#25072746)
Much of Python's growth has been driven by data science. Here, the conda package manager is pretty ubiquitous. Conda packages system and other non-Python dependencies (such as the CUDA SDK), removing the need for data scientists to resolve these non-trivial dependencies themselves. This is likely unneeded/ unwanted for production web app deployments.

Given the varied use cases for Python, the goal of a single package manager may be misguided.

Re:Guido van Rossum joins Microsoft by mumblemumble on Thursday November 12, 2020 @01:37PM (#25073114)
My understanding is that the people who developed Conda would love to have stuck with pip, and originally wanted to see about upgrading pip to support their use cases. And it was GvR himself who told them that that wasn't going to happen.

That was a long time ago, though, when scientific computing was a small niche for Python. It might have been reasonable to say it's not worthwhile to take on all that extra work just to support the needs of a small minority of users. Fast forward the better part of a decade, and it turns out that scientific computing did not stay a small niche. I think that one could make a strong argument that, in retrospect, that brush-off did not end up ultimately serving the best interests of the Python community. It made the community more fragmentary, in a way that divided, and therefore hindered, efforts at addressing what has proven to be one of Python's biggest pain points.

Re:Guido van Rossum joins Microsoft by mixmastamyk on Thursday November 12, 2020 @03:46PM (#25074756)
Conda predates pip by perhaps a decade.
Re:Guido van Rossum joins Microsoft by mkl on Thursday November 12, 2020 @04:37PM (#25075430)
Really? The first release of pip was in 2011 [1] and the earliest release of Conda I can find is 1.1.0 in Nov. 2012 [2], and the first public commit (into an empty repo) was a month earlier [3].

[1] https://en.wikipedia.org/wiki/Pip_(package_manager)

[2] https://github.com/conda/conda/tags?after=1.3.0

[3] https://github.com/conda/conda/commit/c9aea053d8619e1754b24b...

Re:Guido van Rossum joins Microsoft by mixmastamyk on Thursday November 12, 2020 @05:30PM (#25076084)
May be anaconda that I'm thinking of.
Re:Guido van Rossum joins Microsoft by dragonwriter on Thursday November 12, 2020 @05:34PM (#25076136)
Anaconda was released in 2012, as well. Conda is a tool that is part of anaconda.
Re:Guido van Rossum joins Microsoft by mixmastamyk on Thursday November 12, 2020 @05:37PM (#25076161)
This one: https://en.wikipedia.org/wiki/Anaconda_(installer)

I forgive myself, it's pretty confusing :D.

Re:Guido van Rossum joins Microsoft by dragonwriter on Thursday November 12, 2020 @05:40PM (#25076206)
Ah. Name collisions suck.
Re:Guido van Rossum joins Microsoft by mixmastamyk on Thursday November 12, 2020 @06:01PM (#25076445)
Especially when they conceptually do the same thing.
Re:Guido van Rossum joins Microsoft by JAlexoid on Friday November 13, 2020 @01:57AM (#25079735)
And that's another issue with Python ecosystem
Re:Guido van Rossum joins Microsoft by mixmastamyk on Friday November 13, 2020 @06:37PM (#25088853)
Why do you think Python is more susceptible than other platforms?

It is true that PyPi was designed before the author/project naming scheme popularized by github. Other than that I don't see a greater problem with name collisions in Python.

Re:Guido van Rossum joins Microsoft by JAlexoid on Friday November 13, 2020 @11:06PM (#25090212)
Susceptible - yes, all platforms could fall to this.

That's why a strong leadership in a community, or subcommunities, works well. Python lacked this leadership, that leads to millions of half-arsed projects that compete... without moving the whole platform forward. It feels like NIH syndrome has permeated Python. Hopefully that's going to change

Re:Guido van Rossum joins Microsoft by nxpnsv on Thursday November 12, 2020 @02:19PM (#25073724)
I also use poetry for everything. I have 0 problems, things work on my mac, my interns pc, aws instances, I don't even see what problem people are having. Before that I was using pipenv, and before that just good old requirements.txt - there were a few occasional issues, but really not much even then. At this point, I suspect it is more about regurgitating a complaint than a real issue. But, I could be lucky and completely wrong...
Re:Guido van Rossum joins Microsoft by ifore on Thursday November 12, 2020 @05:06PM (#25075765)
- until a few months ago no way to sync an environment with a lockfile (remove packages that shouldn't be there)

- no way to check if the lock file is up to date with the toml file

- no way to install packages from source if the version number is calculated (this will likely never be fixed as it's a design decision to use static package metadata insetad of setup.py, but is an incompatibility with pip)

- no way to have handle multiple environments: you get dependencies and dev-dependencies and that's it. You can fake it with extras, but it's a hack

- if you upgrade to a new python minor version you also have to upgrade to the latest poetry version or things just fail (Something to do with the correct selection of vendored dependencies. May have since been fixed -- new python versions don't come out all that often for me to run into it. And in fairness the latest pip is typically bundled with each python so it avoids that issue)

I still use poetry because it's more standard than hand-rolled pip freeze wrapper scripts, and there's definitely progress (the inability to sync packages was a hard requirement for me but is not fixed) but it's not quite there yet

Re:Guido van Rossum joins Microsoft by nxpnsv on Friday November 13, 2020 @06:03AM (#25081097)
Interesting, i usually rebuild my env from pacakges so don't notice 1,2, or 3. I guess 2 should be fixable by poetry by including more from the toml in the lock file. Point 4 also didn't bother me as I in general just have the main and dev deps, this seems an easier thing to fix for poetry though. I actually have encountered 5 when fiddling around with pyenv.
Re:Guido van Rossum joins Microsoft by disgruntledphd2 on Thursday November 12, 2020 @02:43PM (#25073992)
If you don't need c or c++ dependencies it's ok. If you do, it's very very painful. To be fair, most of the DS libraries can be handled by conda, but if you need both conda and pip, then you're going to have a bad time. (Source: this is my life right now).
Re:Guido van Rossum joins Microsoft by codethief on Thursday November 12, 2020 @06:31PM (#25076783)
Oh man, this is my life right now, too. In my case, we're using tensorflow or tensorflow-gpu, depending on the host system and, unfortunately, only Conda offers tensorflow-gpu with built-in CUDA. Add to this that the tensorflow packages themselves are notoriously bad at specifying dependencies and that different versions of tensorflow(-gpu) are available on conda-forge, depending on your OS.
Re:Guido van Rossum joins Microsoft by disgruntledphd2 on Friday November 13, 2020 @06:17AM (#25081156)
Tensorflow is the worst (along with ReAgent from FB).

I think it's because they have their own internal build systems, but they never play well with pip/conda et al.

One of my recent breakages was installing the recsim package, which pulled in tensorflow and broke my entire app. There's actually a recsim-no-tf package on PyPi, presumably because this happens to loads of people.

Re:Guido van Rossum joins Microsoft by nxpnsv on Friday November 13, 2020 @05:54AM (#25081042)
I see, I miss a lot of issues as don't use any GPU stuff, mainly flask + scipy and friends.... probably this is what saves me.
Re:Guido van Rossum joins Microsoft by disgruntledphd2 on Sunday November 15, 2020 @05:00AM (#25099794)
It's not even the GPU versions, even the CPU stuff causes issues.

The core problem is that pip will happily overwrite your existing dependencies when you attempt to install a new package.

Re:Guido van Rossum joins Microsoft by lmm on Friday November 13, 2020 @01:36AM (#25079618)
If you don't know what the problems with pipenv or requirements.txt were, you're really not qualified to judge whether poetry has solved them or not.
Re:Guido van Rossum joins Microsoft by nxpnsv on Friday November 13, 2020 @03:56AM (#25080450)
You are reading wrong, it did solve my issues with reqs and pipenv. Also you certainly aren’t qualified to judge my qualifications.
Re:Guido van Rossum joins Microsoft by hobofan on Thursday November 12, 2020 @12:56PM (#25072562)
Yes, Poetry is great! I avoided Python for a long time due to it's bad package management/environment handling situation, but Poetry solved all my problems there.
Re:Guido van Rossum joins Microsoft by ccanassa on Friday November 13, 2020 @07:59AM (#25081686)
I wouldn't advise using anything other than the tools blessed by the PSF for mission-critical stuff. Using Poetry for local development is fine but don't build a huge infrastructure around it and don't use in production.

I migrated the CI/CD of my company to Poetry some time ago, it worked fine for some time until we needed a feature that Poetry didn't support. I submitted a PR adding the feature to Poetry but their sole developer was apparently taking some time off and the project remained without any development for several months.

I migrated the CI/CD to use my own Poetry fork but it was very cumbersome, Poetry has a very weird build system so forking it is not simple.

At this point, I realized that I was just wasting time. There is nothing that Poetry does that the other (old and stable) tools don't do. Poetry was the result of me falling for the shiny toy syndrome.