Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.0 kB · 91 lines
Nix
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192{ lib, stdenv, buildPythonPackage, fetchFromGitHub,
# build-system cmake, ninja, pathspec, scikit-build-core,
# dependencies eigen,
# tests pytestCheckHook, numpy, scipy, torch, tensorflow-bin, jax, jaxlib,
nanobind,}:buildPythonPackage rec { pname = "nanobind"; version = "2.8.0"; pyproject = true;
src = fetchFromGitHub { owner = "wjakob"; repo = "nanobind"; tag = "v${version}"; fetchSubmodules = true; hash = "sha256-GGYnyO8eILYNu7va2tMB0QJkBCRDMIfRQO4a9geV49Y="; };
build-system = [ cmake ninja pathspec scikit-build-core ];
dependencies = [ eigen ];
dontUseCmakeBuildDir = true;
# nanobind check requires heavy dependencies such as tensorflow # which are less than ideal to be imported in children packages that # use it as build-system parameter. doCheck = false;
preCheck = '' # build tests make -j $NIX_BUILD_CORES '';
nativeCheckInputs = [ pytestCheckHook numpy scipy torch ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform tensorflow-bin) [ tensorflow-bin jax jaxlib ];
passthru.tests = { pytest = nanobind.overridePythonAttrs { doCheck = true; }; };
meta = { homepage = "https://github.com/wjakob/nanobind"; changelog = "https://github.com/wjakob/nanobind/blob/${src.tag}/docs/changelog.rst"; description = "Tiny and efficient C++/Python bindings"; longDescription = '' nanobind is a small binding library that exposes C++ types in Python and vice versa. It is reminiscent of Boost.Python and pybind11 and uses near-identical syntax. In contrast to these existing tools, nanobind is more efficient: bindings compile in a shorter amount of time, produce smaller binaries, and have better runtime performance. ''; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ parras ]; };}