Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My feeling sadly is because uv is the new thing, it hasn't had to handle anything but the common cases. This kinda gets a mention in the article, but is very much glossed over. There are still some sharp edges, and assumptions which aren't true in general (but are for the easy cases), and this only going to make things worse, because now there's a new set of issues people run into.


As an example of an edge case - you have Python dependencies that wrap C libs that come in x86-64 flavour and arm-64.

Pipenv, when you create a lockfile, will only specify the architecture specific lib that your machine runs on.

So if you're developing on an ARM Macbook, but deploying on an Ubuntu x86-64 box, the Pipenv lockfile will break.

Whereas a Poetry lockfile will work fine.

And I've not found any documentation about how uv handles this, is it the Pipenv way or the Poetry way?


PEP 751 is defining a new lockfile standard for the ecosystem, and tools including uv look committed to collaborating on the design and implementing whatever results. From what I've been able to tell of the surrounding discussion, the standard is intended to address this use case - rather, to be powerful enough that tools can express the necessary per-architecture locking.

The point of the PEP 723 comment style in the OP is that it's human-writable with relatively little thought. Cases like yours are always going to require actually doing the package resolution ahead of time, which isn't feasible by hand. So a separate lock file is necessary if you want resolved dependencies.

If you use this kind of inline script metadata and just specify the Python dependency version, the resolution process is deferred. So you won't have the same kind of control as the script author, but instead the user's tooling can automatically do what's needed for the user's machine. There's inherently a trade-off there.


Your reply is unrelated to my query - is a uv lockfile able to handle multiple arches like a Poetry lockfile?


uv works like poetry, rather than pipenv, in this regards.


Yeah uv uses a platform independent resolution for its lockfiles supports features that Poetry does not, like

- Specifying a subset of platforms to resolve for

- Requiring wheel coverage for specific platforms

- Conflicting optional dependencies

https://docs.astral.sh/uv/concepts/resolution/#universal-res...

https://docs.astral.sh/uv/concepts/projects/config/#conflict...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: