1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 immutabledict,
11 pytools,
12
13 # optional-dependencies
14 matchpy,
15 numpy,
16
17 # tests
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "pymbolic";
23 version = "2024.2.2";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "inducer";
28 repo = "pymbolic";
29 tag = "v${version}";
30 hash = "sha256-07RWdEPhO+n9/FOvIWe4nm9fGekut9X6Tz4HlIkBSpo=";
31 };
32
33 build-system = [ hatchling ];
34
35 dependencies = [
36 immutabledict
37 pytools
38 ];
39
40 optional-dependencies = {
41 matchpy = [ matchpy ];
42 numpy = [ numpy ];
43 };
44
45 nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (builtins.attrValues optional-dependencies);
46
47 pythonImportsCheck = [ "pymbolic" ];
48
49 meta = {
50 description = "Package for symbolic computation";
51 homepage = "https://documen.tician.de/pymbolic/";
52 changelog = "https://github.com/inducer/pymbolic/releases/tag/v${version}";
53 license = lib.licenses.mit;
54 maintainers = [ ];
55 };
56}