Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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 ipywidgets,
18 jsonschema,
19 libcst,
20 matplotlib,
21 networkx,
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 xarray,
36
37 # optional-dependencies
38 furo,
39 nbsphinx,
40 pyvisa-sim,
41 scipy,
42 sphinx,
43 sphinx-issues,
44 towncrier,
45
46 # tests
47 deepdiff,
48 hypothesis,
49 lxml,
50 pip,
51 pytest-asyncio,
52 pytest-cov-stub,
53 pytest-mock,
54 pytest-rerunfailures,
55 pytest-xdist,
56 pytestCheckHook,
57 writableTmpDirAsHomeHook,
58}:
59
60buildPythonPackage (finalAttrs: {
61 pname = "qcodes";
62 version = "0.54.4";
63 pyproject = true;
64
65 src = fetchFromGitHub {
66 owner = "microsoft";
67 repo = "Qcodes";
68 tag = "v${finalAttrs.version}";
69 hash = "sha256-xiD/Iy/5FVadOc9/AxUbGgpOlyli2g6/hwpY1J3/urE=";
70 };
71
72 postPatch = ''
73 substituteInPlace pyproject.toml \
74 --replace-fail \
75 'default-version = "0.54.0dev+Unknown"' \
76 'default-version = "${finalAttrs.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 ipywidgets
92 jsonschema
93 matplotlib
94 networkx
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 xarray
109 ];
110
111 optional-dependencies = {
112 docs = [
113 # autodocsumm
114 furo
115 nbsphinx
116 pyvisa-sim
117 # qcodes-loop
118 scipy
119 sphinx
120 # sphinx-favicon
121 sphinx-issues
122 # sphinx-jsonschema
123 # sphinxcontrib-towncrier
124 towncrier
125 ];
126 loop = [
127 # qcodes-loop
128 ];
129 refactor = [
130 libcst
131 ];
132 zurichinstruments = [
133 # zhinst-qcodes
134 ];
135 };
136
137 nativeCheckInputs = [
138 deepdiff
139 hypothesis
140 libcst
141 lxml
142 pip
143 pytest-asyncio
144 pytest-cov-stub
145 pytest-mock
146 pytest-rerunfailures
147 pytest-xdist
148 pytestCheckHook
149 pyvisa-sim
150 sphinx
151 writableTmpDirAsHomeHook
152 ];
153
154 __darwinAllowLocalNetworking = true;
155
156 pytestFlags = [
157 "-v"
158 "--hypothesis-profile ci"
159 # Follow upstream with settings
160 "--durations=20"
161
162 # ERROR tests/test_interactive_widget.py - DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
163 # given by the platformdirs library. To remove this warning and
164 # see the appropriate new directories, set the environment variable
165 # `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
166 # The use of platformdirs will be the default in `jupyter_core` v6
167 "-Wignore::DeprecationWarning"
168 ];
169
170 disabledTestPaths = [
171 # Test depends on qcodes-loop, causing a cyclic dependency
172 "tests/dataset/measurement/test_load_legacy_data.py"
173 # TypeError
174 "tests/dataset/test_dataset_basic.py"
175 ];
176
177 disabledTestMarks = [
178 "serial"
179 ];
180
181 disabledTests = [
182 # Tests are time-sensitive and power-consuming
183 # Those tests fails repeatably and are flaky
184 "test_access_channels_by_name"
185 "test_access_channels_by_slice"
186 "test_access_channels_by_tuple"
187 "test_aggregator"
188 "test_datasaver"
189 "test_do1d_additional_setpoints_shape"
190 "test_dond_1d_additional_setpoints_shape"
191 "test_field_limits"
192 "test_get_array_in_scalar_param_data"
193 "test_get_parameter_data"
194 "test_measured"
195 "test_ramp_safely"
196 "test_ramp_scaled"
197
198 # more flaky tests
199 # https://github.com/microsoft/Qcodes/issues/5551
200 "test_query_close_once_at_init"
201 "test_step_ramp"
202 ];
203
204 pythonImportsCheck = [ "qcodes" ];
205
206 meta = {
207 description = "Python-based data acquisition framework";
208 changelog = "https://github.com/QCoDeS/Qcodes/releases/tag/${finalAttrs.src.tag}";
209 downloadPage = "https://github.com/QCoDeS/Qcodes";
210 homepage = "https://qcodes.github.io/Qcodes/";
211 license = lib.licenses.mit;
212 maintainers = with lib.maintainers; [
213 GaetanLepage
214 ];
215 };
216})