{ lib, stdenv, buildPythonPackage, rerun, python, # nativeBuildInputs rustPlatform, # dependencies attrs, numpy, opencv4, pillow, pyarrow, semver, typing-extensions, # tests pytestCheckHook, torch, }: buildPythonPackage { pname = "rerun-sdk"; pyproject = true; inherit (rerun) src version cargoDeps postPatch ; nativeBuildInputs = [ rustPlatform.cargoSetupHook rustPlatform.maturinBuildHook rerun ]; dependencies = [ attrs numpy opencv4 pillow pyarrow semver typing-extensions ]; buildAndTestSubdir = "rerun_py"; # https://github.com/NixOS/nixpkgs/issues/289340 # # Alternatively, one could # dontUsePythonImportsCheck = true; # dontUsePytestCheck = true; postInstall = '' rm $out/${python.sitePackages}/rerun_sdk.pth ln -s rerun_sdk/rerun $out/${python.sitePackages}/rerun ''; pythonImportsCheck = [ "rerun" ]; nativeCheckInputs = [ pytestCheckHook torch ]; inherit (rerun) addDlopenRunpaths addDlopenRunpathsPhase; postPhases = lib.optionals stdenv.hostPlatform.isLinux [ "addDlopenRunpathsPhase" ]; disabledTests = [ # numpy 2 incompatibility: AssertionError / IndexError # Issue: https://github.com/rerun-io/rerun/issues/9105 # PR: https://github.com/rerun-io/rerun/pull/9109 "test_any_value" "test_bad_any_value" "test_none_any_value" ]; disabledTestPaths = [ # "fixture 'benchmark' not found" "tests/python/log_benchmark/test_log_benchmark.py" ]; meta = { description = "Python bindings for `rerun` (an interactive visualization tool for stream data)"; inherit (rerun.meta) changelog homepage license maintainers ; mainProgram = "rerun"; }; }