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
This commit is contained in:
Andrew Kvalheim
2025-08-15 07:30:33 -07:00
parent fbcf476f79
commit 53ff77e654
@@ -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