python3Packages.nixl: init at 1.0.1

This commit is contained in:
Gaetan Lepage
2026-04-23 23:11:50 +00:00
parent 19d44034f7
commit 62e106f887
3 changed files with 91 additions and 0 deletions
+5
View File
@@ -137,6 +137,11 @@ effectiveStdenv.mkDerivation (finalAttrs: {
passthru = {
updateScript = nix-update-script { };
# propagate the stdenv so that the python API can consume it directly
stdenv = effectiveStdenv;
pythonPackage = python3Packages.nixl;
};
meta = {
@@ -0,0 +1,84 @@
{
lib,
buildPythonPackage,
python,
nixl,
# build-system
build,
meson-python,
pybind11,
pytest,
pyyaml,
setuptools,
types-pyyaml,
# dependencies
numpy,
torch,
config,
cudaSupport ? config.cudaSupport,
cudaPackages,
}:
buildPythonPackage.override { inherit (nixl) stdenv; } (finalAttrs: {
inherit (nixl)
pname
version
src
__structuredAttrs
strictDeps
nativeBuildInputs
dontUseCmakeConfigure
buildInputs
mesonFlags
;
pyproject = true;
postPatch = (nixl.postPatch or "") + ''
substituteInPlace pyproject.toml \
--replace-fail \
'"patchelf",' \
""
'';
build-system = [
build
meson-python
pybind11
pytest
pyyaml
setuptools
types-pyyaml
];
dontUseMesonConfigure = true;
dependencies = [
numpy
torch
];
# Install the `nixl` shim module (re-exports nixl_cu{12,13}).
# Upstream builds this as a separate wheel via `uv build` (nixl-meta), but that doesn't work in
# the sandbox.
postInstall = ''
install -Dm644 \
src/bindings/python/nixl-meta/nixl/__init__.py \
"$out/${python.sitePackages}/nixl/__init__.py"
'';
pythonImportsCheck = [
"nixl"
]
++ lib.optionals cudaSupport [
"nixl_cu${cudaPackages.cudaMajorVersion}"
];
# No tests we can run in the sandbox
doCheck = false;
meta = nixl.meta // {
description = "Python API for nixl";
};
})
+2
View File
@@ -11132,6 +11132,8 @@ self: super: with self; {
nix-prefetch-github = callPackage ../development/python-modules/nix-prefetch-github { };
nixl = callPackage ../development/python-modules/nixl { inherit (pkgs) nixl; };
nixpkgs-plugin-update = callPackage ../development/python-modules/nixpkgs-plugin-update { };
nixpkgs-pytools = callPackage ../development/python-modules/nixpkgs-pytools { };