at 25.11-pre 1.8 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 pythonOlder, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 makefun, 12 multipledispatch, 13 numpy, 14 opt-einsum, 15 typing-extensions, 16 17 # checks 18 pyro-ppl, 19 torch, 20 pandas, 21 pillow, 22 pyro-api, 23 pytestCheckHook, 24 pytest-xdist, 25 requests, 26 scipy, 27 torchvision, 28 29 stdenv, 30}: 31 32buildPythonPackage rec { 33 pname = "funsor"; 34 version = "0.4.6"; 35 pyproject = true; 36 37 disabled = pythonOlder "3.7"; 38 39 src = fetchFromGitHub { 40 owner = "pyro-ppl"; 41 repo = "funsor"; 42 tag = version; 43 hash = "sha256-Prj1saT0yoPAP8rDE0ipBEpR3QMk4PS12VSJlxc22p8="; 44 }; 45 46 build-system = [ setuptools ]; 47 48 dependencies = [ 49 makefun 50 multipledispatch 51 numpy 52 opt-einsum 53 typing-extensions 54 ]; 55 56 nativeCheckInputs = [ 57 # Backend 58 pyro-ppl 59 torch 60 61 pandas 62 pillow 63 pyro-api 64 pytestCheckHook 65 pytest-xdist 66 requests 67 scipy 68 torchvision 69 ]; 70 71 preCheck = '' 72 export FUNSOR_BACKEND=torch 73 ''; 74 75 pythonImportsCheck = [ "funsor" ]; 76 77 disabledTests = 78 [ 79 # `test_torch_save` got broken by the update of torch (2.3.1 -> 2.4.0): 80 # FutureWarning: You are using `torch.load` with `weights_only=False`... 81 # TODO: Try to re-enable this test at next release 82 "test_torch_save" 83 ] 84 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 85 # Failures related to JIT 86 # RuntimeError: required keyword attribute 'Subgraph' has the wrong type 87 "test_local_param_ok" 88 "test_plate_ok" 89 ]; 90 91 meta = { 92 description = "Functional tensors for probabilistic programming"; 93 homepage = "https://funsor.pyro.ai"; 94 changelog = "https://github.com/pyro-ppl/funsor/releases/tag/${version}"; 95 license = lib.licenses.asl20; 96 maintainers = with lib.maintainers; [ GaetanLepage ]; 97 }; 98}