Thread of 2 posts
jump to replies16 visible replies; 1 more reply hidden or not public
back to topI always thought that managing dependencies, versions etc. was so odd in Python... even in Typescript/Javascript it's more straightforward 😅 but my guess would also be uv, haven't even heard of poetry.
@graves501
The AI/ML crowd likes #conda because it will also manage non-python dependencies like C++ libraries. But I think that is more like a whole build system? I just need a couple extra modules for the simple scripts I do…
@bryan in an ecosystem made of failure, poetry is king shit of failure.
uv is good, and avoids the common failure mode of Python packaging/deploy tools. The common failure mode is that Python developers love breaking backward compatibility more than I have ever loved anything, and so poetry, pip/pipenv, setuptools, virtualenv, all find ways to fail for seemingly unrelated changes. uv, being written in Rust, cannot be broken by Python developers.
@diazona
Never even heard of hatch, flit, or pdm! It looks like uv is the simplest one to move to from venv.
@bryan Maybe so. I think it depends on what you've been doing with venv.
@diazona
I basically use like 1-5 different addons via pip. Sometimes a pip doesnt work with latest python so need to start with older python. I think my mac has 3-4 different python installs.
@bryan Oh wait, are you *developing* Python packages or *using* them? pip is normally for users, not developers.
I mean, developers are users it too, so technically we do all use pip or some equivalent, but it's a basic tool whose scope excludes a lot of the other features that a package developer needs. It'd be very common that a developer doesn't use pip very much directly, but via another tool that wraps it or provides higher-level functionality. The tools I mentioned (hatch etc.) are examples of such higher-level tools, among other things they can do.
@diazona
No I’m just using pip as a user. I’ll use Pandas for example. Maybe some date libraries, SQLite, etc.
@bryan Ah I see, sorry, I mistakenly thought we were talking about the package developer's experience. As a user you wouldn't need those other tools I mentioned (hatch, poetry, pdm, etc.); they're meant for package developers.
@bryan As a user I suppose it makes more sense for you to be manually creating virtual environments (with venv), since you don't have to manage them in the complex ways that developers have to. Although there are some venv wrapper tools that can simplify the user experience in certain cases: pipx, pipenv, and uv come to mind. (Well, uv kinda does everything - you can use it as a replacement for pip or also as a replacement for those higher level tools.)
It is definitely very normal to have many venvs and several versions of Python installed. (Though I don't know that it's normal to run into errors using pip that often 🤷 but you gotta do what works)
@bryan It is easier to move away from uv than from poetry because poetry's pyproject.toml section is now idiosyncratic compared to other tooling.
@mistersql
Thanks for the warning.
@bryan not in my experience, but a lot of people really like both projects. Sometimes I think more just talking about them than actually doing stuff lol
@bryan
@hynek has several good uv videos including this one https://www.youtube.com/watch?v=8UuW8o4bHbw&feature=youtu.be,
Which does a great job of introducing why uv is a good choice. He also has a series on building project layouts in uv.
@bryan in my limited experience of a year or so working in smaller commercial python (Django) web projects I've used both poetry and uv. some hosts like heroku or fly.io come with support or easily found build packs for poetry -- so it made sense to reach for poetry from a DX perspective. in practice I've noticed uv is blazing fast.
