1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 poetry-core,
7 pythonOlder,
8 numpy,
9 deprecation,
10 hightime,
11 tzlocal,
12 python-decouple,
13 click,
14 distro,
15 requests,
16 sphinx,
17 sphinx-rtd-theme,
18 grpcio,
19 protobuf,
20 toml,
21}:
22
23buildPythonPackage rec {
24 pname = "nidaqmx";
25 version = "1.0.2";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "ni";
30 repo = "nidaqmx-python";
31 rev = "${version}";
32 hash = "sha256-rf5cGq3Iv6ucURSUFuFANQzaGeufBZ+adjKlg4B5DRY=";
33 };
34
35 disabled = pythonOlder "3.8";
36
37 build-system = [ poetry-core ];
38
39 prePatch = ''
40 substituteInPlace pyproject.toml \
41 --replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api'
42
43 substituteInPlace pyproject.toml \
44 --replace-fail '["poetry>=1.2"]' '["poetry-core>=1.0.0"]'
45 '';
46
47 dependencies =
48 [
49 numpy
50 deprecation
51 hightime
52 tzlocal
53 python-decouple
54 click
55 requests
56 ]
57 ++ lib.optionals stdenv.hostPlatform.isLinux [
58 distro
59 ];
60
61 passthru.optional-dependencies = {
62 docs = [
63 sphinx
64 sphinx-rtd-theme
65 toml
66 ];
67 grpc = [
68 grpcio
69 protobuf
70 ];
71 };
72
73 # Tests require hardware
74 doCheck = false;
75
76 pythonImportsCheck = [ "nidaqmx" ];
77
78 meta = {
79 changelog = "https://github.com/ni/nidaqmx-python/releases/tag/v${version}";
80 description = "API for interacting with the NI-DAQmx driver";
81 homepage = "https://github.com/ni/nidaqmx-python";
82 license = lib.licenses.mit;
83 maintainers = with lib.maintainers; [ fsagbuya ];
84 };
85}