1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8 versioningit,
9
10 # dependencies
11 broadbean,
12 cf-xarray,
13 dask,
14 h5netcdf,
15 h5py,
16 ipykernel,
17 ipython,
18 ipywidgets,
19 jsonschema,
20 libcst,
21 matplotlib,
22 numpy,
23 opentelemetry-api,
24 packaging,
25 pandas,
26 pillow,
27 pyarrow,
28 pyvisa,
29 ruamel-yaml,
30 tabulate,
31 tqdm,
32 typing-extensions,
33 uncertainties,
34 websockets,
35 wrapt,
36 xarray,
37
38 # optional-dependencies
39 furo,
40 jinja2,
41 nbsphinx,
42 pyvisa-sim,
43 scipy,
44 sphinx,
45 sphinx-issues,
46 towncrier,
47
48 # tests
49 deepdiff,
50 hypothesis,
51 lxml,
52 pip,
53 pytest-asyncio,
54 pytest-cov-stub,
55 pytest-mock,
56 pytest-rerunfailures,
57 pytest-xdist,
58 pytestCheckHook,
59 writableTmpDirAsHomeHook,
60}:
61
62buildPythonPackage rec {
63 pname = "qcodes";
64 version = "0.53.0";
65 pyproject = true;
66
67 src = fetchFromGitHub {
68 owner = "microsoft";
69 repo = "Qcodes";
70 tag = "v${version}";
71 hash = "sha256-uXVL25U7szJF/v7OEsB9Ww1h6ziBxsMJdqhZG5qn0VU=";
72 };
73
74 postPatch = ''
75 substituteInPlace pyproject.toml \
76 --replace-fail 'default-version = "0.0"' 'default-version = "${version}"'
77 '';
78
79 build-system = [
80 setuptools
81 versioningit
82 ];
83
84 dependencies = [
85 broadbean
86 cf-xarray
87 dask
88 h5netcdf
89 h5py
90 ipykernel
91 ipython
92 ipywidgets
93 jsonschema
94 matplotlib
95 numpy
96 opentelemetry-api
97 packaging
98 pandas
99 pillow
100 pyarrow
101 pyvisa
102 ruamel-yaml
103 tabulate
104 tqdm
105 typing-extensions
106 uncertainties
107 websockets
108 wrapt
109 xarray
110 ];
111
112 optional-dependencies = {
113 docs = [
114 # autodocsumm
115 furo
116 jinja2
117 nbsphinx
118 pyvisa-sim
119 # qcodes-loop
120 scipy
121 sphinx
122 # sphinx-favicon
123 sphinx-issues
124 # sphinx-jsonschema
125 # sphinxcontrib-towncrier
126 towncrier
127 ];
128 loop = [
129 # qcodes-loop
130 ];
131 refactor = [
132 libcst
133 ];
134 zurichinstruments = [
135 # zhinst-qcodes
136 ];
137 };
138
139 nativeCheckInputs = [
140 deepdiff
141 hypothesis
142 libcst
143 lxml
144 pip
145 pytest-asyncio
146 pytest-cov-stub
147 pytest-mock
148 pytest-rerunfailures
149 pytest-xdist
150 pytestCheckHook
151 pyvisa-sim
152 sphinx
153 writableTmpDirAsHomeHook
154 ];
155
156 __darwinAllowLocalNetworking = true;
157
158 pytestFlags = [
159 "-v"
160 "--hypothesis-profile ci"
161 # Follow upstream with settings
162 "--durations=20"
163 ];
164
165 disabledTestPaths = [
166 # Test depends on qcodes-loop, causing a cyclic dependency
167 "tests/dataset/measurement/test_load_legacy_data.py"
168 # TypeError
169 "tests/dataset/test_dataset_basic.py"
170 ];
171
172 disabledTestMarks = [
173 "serial"
174 ];
175
176 disabledTests = [
177 # Tests are time-sensitive and power-consuming
178 # Those tests fails repeatably and are flaky
179 "test_access_channels_by_name"
180 "test_access_channels_by_slice"
181 "test_access_channels_by_tuple"
182 "test_aggregator"
183 "test_datasaver"
184 "test_do1d_additional_setpoints_shape"
185 "test_dond_1d_additional_setpoints_shape"
186 "test_field_limits"
187 "test_get_array_in_scalar_param_data"
188 "test_get_parameter_data"
189 "test_measured"
190 "test_ramp_safely"
191 "test_ramp_scaled"
192
193 # more flaky tests
194 # https://github.com/microsoft/Qcodes/issues/5551
195 "test_query_close_once_at_init"
196 "test_step_ramp"
197 ];
198
199 pythonImportsCheck = [ "qcodes" ];
200
201 meta = {
202 description = "Python-based data acquisition framework";
203 changelog = "https://github.com/QCoDeS/Qcodes/releases/tag/${src.tag}";
204 downloadPage = "https://github.com/QCoDeS/Qcodes";
205 homepage = "https://qcodes.github.io/Qcodes/";
206 license = lib.licenses.mit;
207 maintainers = with lib.maintainers; [ evilmav ];
208 };
209}