diff --git a/pkgs/by-name/uv/uv-sort/package.nix b/pkgs/by-name/uv/uv-sort/package.nix new file mode 100644 index 00000000000000..5ef3a21e9d7d11 --- /dev/null +++ b/pkgs/by-name/uv/uv-sort/package.nix @@ -0,0 +1,42 @@ +{ + lib, + fetchPypi, + python3Packages, +}: + +python3Packages.buildPythonApplication rec { + pname = "uv-sort"; + version = "0.5.0"; + pyproject = true; + + # Build from GitHub does not work. Use fetchPypi instead of fetchFromGitHub. + # See https://github.com/NixOS/nixpkgs/pull/388382#issuecomment-2708857805 + src = fetchPypi { + pname = "uv_sort"; + inherit version; + hash = "sha256-qCShDuKBFS4omcsntZ1wzRtAKTbp8CfTw0IIAgxBvcE="; + }; + + build-system = with python3Packages; [ + hatchling + uv-dynamic-versioning + ]; + + dependencies = with python3Packages; [ + packaging + tomlkit + typer + ]; + + nativeCheckInputs = [ + python3Packages.pytestCheckHook + ]; + + meta = { + description = "Sort uv's dependencies alphabetically"; + homepage = "https://github.com/ninoseki/uv-sort"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aaronjheng ]; + mainProgram = "uv-sort"; + }; +}