From 53ff77e6546572980ebdee2c8d84b464ddb8befc Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 15 Aug 2025 07:15:57 -0700 Subject: [PATCH] python3Packages.busylight-for-humans: add optional dependencies of busyserve Before: $ nix-shell --packages 'python3Packages.busylight-for-humans' --run 'busyserve' The package `uvicorn` is missing, unable to serve the busylight API. After: $ nix-shell --packages 'python3Packages.busylight-for-humans.overridePythonAttrs (p: { dependencies = p.dependencies ++ p.optional-dependencies.webapi; })' --run 'busyserve' INFO: Started server process [47202] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) Upstream: https://github.com/JnyJny/busylight/blob/v0.35.2/pyproject.toml#L26 --- .../python-modules/busylight-for-humans/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/busylight-for-humans/default.nix b/pkgs/development/python-modules/busylight-for-humans/default.nix index f60436f64846..ea27f5bcaef8 100644 --- a/pkgs/development/python-modules/busylight-for-humans/default.nix +++ b/pkgs/development/python-modules/busylight-for-humans/default.nix @@ -3,6 +3,7 @@ bitvector-for-humans, buildPythonPackage, fetchFromGitHub, + fastapi, hidapi, loguru, poetry-core, @@ -11,6 +12,7 @@ pytestCheckHook, pythonOlder, typer, + uvicorn, webcolors, udevCheckHook, }: @@ -40,6 +42,13 @@ buildPythonPackage rec { webcolors ]; + optional-dependencies = { + webapi = [ + fastapi + uvicorn + ]; + }; + nativeCheckInputs = [ pytestCheckHook pytest-mock