-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython-package.nix
More file actions
107 lines (97 loc) · 1.92 KB
/
Copy pathpython-package.nix
File metadata and controls
107 lines (97 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
lib,
python312Packages,
ffmpeg-headless,
tesseract,
glib,
zlib,
libglvnd,
}:
let
py = python312Packages;
pname = "lx-dtypes";
version = "0.1.1";
src = lib.cleanSourceWith {
src = ./.;
filter =
path: type:
let
rel = lib.removePrefix "${toString ./.}/" (toString path);
base = builtins.baseNameOf (toString path);
ignored_base_names = [
".devenv"
".direnv"
".env"
".git"
".mypy_cache"
".pytest_cache"
".ruff_cache"
".venv"
"__pycache__"
"result"
];
ignored_prefixes = [
"docs/_build/"
"htmlcov/"
];
in
!(builtins.elem base ignored_base_names || lib.any (prefix: lib.hasPrefix prefix rel) ignored_prefixes);
};
python_deps = with py; [
bibtexparser
django
django-ninja
django-stubs
django-stubs-ext
icecream
numpy
opencv-python-headless
openpyxl
pandas
pandas-stubs
pandera
pillow
pydantic
python-ffmpeg
pyyaml
requests
scikit-learn
scipy
types-pyyaml
];
runtime_tools = [
ffmpeg-headless
tesseract
];
in
py.buildPythonPackage {
inherit pname version src;
pyproject = true;
nativeBuildInputs = [
py.hatchling
];
propagatedBuildInputs = python_deps;
buildInputs = [
glib
zlib
libglvnd
] ++ runtime_tools;
pythonImportsCheck = [
"lx_dtypes"
"lx_dtypes.models.interface"
];
makeWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath runtime_tools}"
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
glib
zlib
libglvnd
]}"
];
meta = with lib; {
description = "Python package for lx-dtypes data models and knowledge-base tooling";
homepage = "https://github.com/wg-lux/lx-data-models";
license = licenses.mit;
platforms = platforms.linux;
};
}