TyberiusPrime / uv2nix_hammer_overrides

Override collection for uv2nix
MIT License
9 stars 1 forks source link

uv2nix_hammer_overrides

uv2nix does not contain an override collection by design.

The uv2nix_hammer is a tool to automatically generate such overrides on demand.

These overrides are then collected in this repository so that downstream users can easily use uv2nix for the most common python packages.

Current state (2024-11-07): I have done a sweep through the 15.6k 'most important' python packages, prefering wheels. About 13.4k build, another 1000 have ended up on the exclusion list for various reasons, and the remaining ~650 are in limbo.

Poetry2nix might also benefit from these overrides, there's an example how to use them below. Note that poetry2nix builds python packages very differently from uv2nix, namely using nixpkgs python builders which have all kinds of drawbacks.

Usage:

Example uv2nix flake.nix

Example poetry2nix flake.nix poetry2nix example

Scope of the 'sweep'

Open tasks:

Faq

My packages still fail:

The first thing you might want to check is if there's a 'Downgrade*' rule in overrides//rules.toml (or it's dependencies :( ). That might teach you that you have to restrict something else to be 'not the newest version'. Sorry, no automatic checking for that yet.

"error: attribute '' missing" during nix eval

One of your packages (or at least one dependency) has a limbo dependency - it's not declared correctly and uv didn't lock it. You can add it to the dependencies in you pyproject.toml.

Cython vs Cython_0

Cython recently underwent a non-backwards compatible jump from 0.29 to 1.0. uv2nix_hammer_overrrides provides the former as cython_0, like nixpkgs does. It's not pretty, but it works for now.