1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, setuptools
6, versioningit
7, wheel
8
9 # mandatory
10, broadbean
11, h5netcdf
12, h5py
13, importlib-metadata
14, ipywidgets
15, ipykernel
16, jsonschema
17, matplotlib
18, numpy
19, opencensus
20, opencensus-ext-azure
21, opentelemetry-api
22, packaging
23, pandas
24, pyvisa
25, ruamel-yaml
26, tabulate
27, typing-extensions
28, tqdm
29, uncertainties
30, websockets
31, wrapt
32, xarray
33, ipython
34, pillow
35, rsa
36
37 # optional
38, qcodes-loop
39, slack-sdk
40
41 # test
42, pip
43, pytestCheckHook
44, deepdiff
45, hypothesis
46, lxml
47, pytest-asyncio
48, pytest-mock
49, pytest-rerunfailures
50, pytest-xdist
51, pyvisa-sim
52, sphinx
53}:
54
55buildPythonPackage rec {
56 pname = "qcodes";
57 version = "0.40.0";
58 format = "pyproject";
59
60 disabled = pythonOlder "3.9";
61
62 src = fetchPypi {
63 inherit pname version;
64 sha256 = "sha256-C8/ltX3tSxCbbheuel3BjIkRBl/E92lK709QYx+2FL0=";
65 };
66
67 postPatch = ''
68 substituteInPlace pyproject.toml \
69 --replace 'versioningit ~=' 'versioningit >='
70 '';
71
72 nativeBuildInputs = [
73 setuptools
74 versioningit
75 wheel
76 ];
77
78 propagatedBuildInputs = [
79 broadbean
80 h5netcdf
81 h5py
82 ipykernel
83 ipython
84 ipywidgets
85 jsonschema
86 matplotlib
87 numpy
88 opencensus
89 opencensus-ext-azure
90 opentelemetry-api
91 packaging
92 pandas
93 pillow
94 pyvisa
95 rsa
96 ruamel-yaml
97 tabulate
98 tqdm
99 typing-extensions
100 uncertainties
101 websockets
102 wrapt
103 xarray
104 ] ++ lib.optionals (pythonOlder "3.10") [
105 importlib-metadata
106 ];
107
108 passthru.optional-dependencies = {
109 loop = [
110 qcodes-loop
111 ];
112 slack = [
113 slack-sdk
114 ];
115 };
116
117 __darwinAllowLocalNetworking = true;
118
119 nativeCheckInputs = [
120 deepdiff
121 hypothesis
122 lxml
123 pip
124 pytest-asyncio
125 pytest-mock
126 pytest-rerunfailures
127 pytest-xdist
128 pytestCheckHook
129 pyvisa-sim
130 sphinx
131 ];
132
133 pytestFlagsArray = [
134 # Follow upstream with settings
135 "--durations=20"
136 ];
137
138 disabledTestPaths = [
139 # Test depends on qcodes-loop, causing a cyclic dependency
140 "qcodes/tests/dataset/measurement/test_load_legacy_data.py"
141 ];
142
143 disabledTests = [
144 # Tests are time-sensitive and power-consuming
145 # Those tests fails repeatably
146 "test_access_channels_by_slice"
147 "test_do1d_additional_setpoints_shape"
148 "test_dond_1d_additional_setpoints_shape"
149 "test_field_limits"
150 "test_get_array_in_scalar_param_data"
151 "test_get_parameter_data"
152 "test_ramp_safely"
153 ];
154
155 pythonImportsCheck = [
156 "qcodes"
157 ];
158
159 postInstall = ''
160 export HOME="$TMPDIR"
161 '';
162
163 meta = with lib; {
164 changelog = "https://github.com/QCoDeS/Qcodes/releases/tag/v${version}";
165 description = "Python-based data acquisition framework";
166 downloadPage = "https://github.com/QCoDeS/Qcodes";
167 homepage = "https://qcodes.github.io/Qcodes/";
168 license = licenses.mit;
169 maintainers = with maintainers; [ evilmav ];
170 };
171}