nixpkgs/pkgs/development/python-modules/pynvml/default.nix
Martin Weinelt 0215034f25 python3.pkgs: Migrate fetchers to use hash
when they already rely on SRI hashes.
2023-03-03 23:59:29 +01:00

39 lines
830 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, substituteAll
, pythonOlder
, cudatoolkit
, addOpenGLRunpath
}:
buildPythonPackage rec {
pname = "pynvml";
version = "11.5.0";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
hash = "sha256-0CeyG5WxCIufwngRf59ht8Z/jjOnh+n4P3NfD3GsMtA=";
};
patches = [
(substituteAll {
src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch;
inherit (addOpenGLRunpath) driverLink;
})
];
propagatedBuildInputs = [ cudatoolkit ];
doCheck = false; # no tests in PyPi dist
pythonImportsCheck = [ "pynvml" "pynvml.smi" ];
meta = with lib; {
description = "Python bindings for the NVIDIA Management Library";
homepage = "https://www.nvidia.com";
license = licenses.bsd3;
maintainers = [ maintainers.bcdarwin ];
};
}