python3Packages.pyg-lib: init at 0.7.0

This commit is contained in:
Gaetan Lepage
2026-06-09 18:27:40 +00:00
parent 622f1a4cb4
commit 4347f5d54b
2 changed files with 88 additions and 0 deletions
@@ -0,0 +1,86 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# build-system
cmake,
ninja,
setuptools,
torch,
# tests
pytestCheckHook,
}:
let
inherit (torch) cudaPackages cudaSupport cudaCapabilities;
in
buildPythonPackage.override { inherit (torch) stdenv; } (finalAttrs: {
pname = "pyg-lib";
version = "0.7.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "pyg-team";
repo = "pyg-lib";
tag = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-czHSOIocmoup502kLS8v+aeu6fVPPhqFh3hbGcFvNEQ=";
};
build-system = [
cmake
ninja
setuptools
torch
];
dontUseCmakeConfigure = true;
nativeBuildInputs = lib.optionals cudaSupport [
cudaPackages.cuda_nvcc
];
env = lib.optionalAttrs cudaSupport {
TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" cudaCapabilities}";
};
buildInputs = [
torch.cxxdev
torch
];
pythonImportsCheck = [ "pyg_lib" ];
nativeCheckInputs = [
pytestCheckHook
];
preCheck = ''
rm -rf pyg_lib
'';
disabledTests =
lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox:
# RuntimeError: Failed to initialize cpuinfo!
"test_scatter_mean_forward_dtypes"
"test_scatter_sum_forward_dtypes"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Trace/BPT trap: 5
"test_hetero_neighbor_sampler_temporal_sample"
];
meta = {
description = "Low-Level Graph Neural Network Operators for PyG";
homepage = "https://github.com/pyg-team/pyg-lib";
changelog = "https://github.com/pyg-team/pyg-lib/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = with lib.licenses; [
mit
bsd3
];
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})
+2
View File
@@ -14118,6 +14118,8 @@ self: super: with self; {
pyfzf = callPackage ../development/python-modules/pyfzf { inherit (pkgs) fzf; };
pyg-lib = callPackage ../development/python-modules/pyg-lib { };
pygal = callPackage ../development/python-modules/pygal { };
# pygame-ce is better maintained upstream, the breaking point was https://github.com/NixOS/nixpkgs/pull/475917#issuecomment-3706940043