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