Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
514 lines (474 loc) · 14.8 KB
/
Copy pathpyproject.toml
File metadata and controls
514 lines (474 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
[build-system]
requires = [
"setuptools >= 77.0.0",
"versioningit >= 2.2.1",
]
build-backend = 'setuptools.build_meta'
[project]
name = "qcodes"
maintainers = [{name = "QCoDeS Core Developers", email = "qcodes-support@microsoft.com"}]
description = "Python-based data acquisition framework developed by the Copenhagen / Delft / Sydney / Microsoft quantum computing consortium"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Scientific/Engineering",
]
license = "MIT"
readme = "README.rst"
requires-python = ">=3.12"
dependencies = [
"broadbean>=0.11.0",
"h5netcdf>=1.3.0",
"h5py>=3.10.0",
"ipywidgets>=8.0.0,<9.0.0",
"ipykernel>=6.12.0", # implicitly required by ipywidgets >=8.0.5
"jsonschema>=4.9.0",
"matplotlib>=3.8.0",
"networkx>=3.1",
"numpy>=1.26.0",
"packaging>=20.0",
"pandas>=2.1.1",
"pyarrow>=14.0.0", # will become a requirement of pandas. Installing explicitly silences a warning
"pyvisa>=1.12.0, <1.17.0",
"ruamel.yaml>=0.16.0,!=0.16.6",
"tabulate>=0.9.0",
"typing_extensions>=4.12.0",
"tqdm>=4.59.0",
"uncertainties>=3.2.0",
"versioningit>=2.2.1",
"websockets>=11.0",
"xarray>=2023.08.0",
"cf_xarray>=0.8.4",
"opentelemetry-api>=1.17.0",
"pillow>=10.2.0",
"dask>=2022.1.0", # we are making use of xarray features that requires dask implicitly
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/microsoft/Qcodes"
Documentation = "https://microsoft.github.io/Qcodes/"
Source = "https://github.com/microsoft/qcodes"
Tracker = "https://github.com/microsoft/Qcodes/issues"
Changelog = "https://microsoft.github.io/Qcodes/changes/index.html"
[project.optional-dependencies]
zurichinstruments = ["zhinst-qcodes>=0.3"]
minicircuits_usb_spdt = ["pythonnet>3.0.4"]
minicircuits_rudat = ["pywinusb>=0.4.2"]
loop = ["qcodes_loop>=0.1.2"]
test = [
"coverage[toml]>=7.10.5",
"hypothesis>=6.130.0",
"lxml>=4.9.4",
"lxml-stubs>=0.4.0",
"mypy>=1.20.0",
"pandas-stubs>=1.2.0.1",
"parso>=0.8.6", # sphinx extension tests
"pytest>=8.2.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=5.0.0",
"pytest-mock>=3.13.0",
"pytest-rerunfailures>=14.0",
"pytest-xdist>=3.6.1",
"PyVisa-sim>=0.6.0",
"sphinx>=4.5.0", # sphinx extension tests
"types-jsonschema>=4.16.0",
"types-networkx >= 3.6.1.20260512", # minimum version required for generic data types in graph
"types_requests>=0.1.8",
"types-tabulate>=0.1.0",
"types-tqdm>=4.64.6",
"types_pywin32>=305.0.0.7",
"qcodes_loop>=0.1.1",
"zhinst.qcodes>=0.5; python_version < '3.15'", # typecheck zhinst driver alias. zhinst-core has no Python 3.15 wheels yet
"libcst>=1.2.0", # refactor tests
]
docs = [
"autodocsumm>=0.2.9",
"nbsphinx>=0.8.9",
"parso>=0.8.6", # qcodes.sphinx_extensions.parse_parameter_attr
"PyVisa-sim>=0.6.0",
"sphinx>=7.3.5",
"sphinx-favicon>=1.0",
"sphinx-issues>=3.0.1",
"sphinx-jsonschema>=1.19.1",
"furo>=2024.8.6",
"sphinxcontrib-towncrier>=0.5.0a0",
"towncrier>=24.8.0,<27.0.0", # sphinxcontrib-towncrier is likely to break with new versions
"scipy>=1.12.0", # examples using scipy
"qcodes_loop>=0.1.1", # legacy dataset import examples
"intersphinx_registry>=0.2603.16"
]
refactor = [
"libcst>=1.2.0"
]
[project.scripts]
qcodes-monitor = "qcodes.monitor.monitor:main"
qcodes-refactor = "qcodes.extensions._refactor:main"
qcodes-dynacool-server = "qcodes.instrument_drivers.QuantumDesign.DynaCoolPPMS.private.server:run_server"
[project.entry-points."qcodes.dataset.on_export"]
log_exported_ds = "qcodes.extensions:log_dataset_export_info"
[tool.coverage.run]
source_pkgs = ["qcodes"]
omit = [
"src/qcodes/__init__.py",
"*/__init__.py",
]
disable_warnings = ["module-not-measured"]
# this warning is triggered when pytest-cov is used together with pytest-xdist
# https://github.com/pytest-dev/pytest-cov/issues/693
# coverage however, still seems to work fine.
[tool.mypy]
strict_optional = true
show_column_numbers = true
show_error_codes = true
enable_error_code = "ignore-without-code"
# strict confic. Eventually we would like to
# turn all of these on. These are all setings
# turned on by strict as of mypy 0.971
warn_unused_configs = true
# waiting for variadic generics so we
# can type numpy array constructors
disallow_any_generics = false
# we subclass non typed classes (from ipython)
disallow_subclassing_any = false
# we are calling into untyped code from 3th parties
disallow_untyped_calls = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
# triggers warnings in untyped code
check_untyped_defs = false
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
# this triggers failures due to returning
# values from untyped 3th party libs
warn_return_any = false
no_implicit_reexport = true
strict_equality = true
[[tool.mypy.overrides]]
module = [
"tests.*",
"qcodes.instrument_drivers.Harvard.*",
]
disallow_untyped_defs = false
disallow_incomplete_defs = false
# these are packages that we import
# but don't have installed by default
[[tool.mypy.overrides]]
module = [
"clr",
"gclib",
"mcl_RF_Switch_Controller64",
"mcl_RF_Switch_Controller_NET45",
"pywinusb.*",
"System.IO",
]
ignore_missing_imports = true
# zhinst-qcodes is not installable on all Python versions we test
# (no Python 3.15 wheels for zhinst-core yet). When it is installed,
# the Zurich Instruments driver aliases are still typechecked against it.
[[tool.mypy.overrides]]
module = ["zhinst.*"]
ignore_missing_imports = true
[tool.pyright]
include = ["src","tests"]
ignore = [
"src/qcodes/instrument_drivers/Harvard/Decadac.py",
]
reportMissingTypeStubs = true
reportDeprecated = true
typeCheckingMode = "strict"
reportUnknownVariableType = "none"
reportPrivateUsage = "none"
reportUnknownMemberType = "none"
reportUnknownParameterType = "none"
reportMissingTypeArgument = "none"
reportUnknownArgumentType = "none"
reportUnusedFunction = "none"
reportUnusedImport = "none"
reportUnknownLambdaType = "none"
reportUnnecessaryIsInstance = "none"
reportUntypedNamedTuple = "none"
reportUnnecessaryComparison = "none"
reportConstantRedefinition = "none"
reportUnusedClass = "none"
reportUnnecessaryCast = "none" # mypy already checks this. If it fails for pyright its because mypy requires it
reportUnnecessaryTypeIgnoreComment = "none"
# it would be nice to filter for not needed pyright ignore comments
# but not type ignore comments since mypy already checks if type ignores are necessary
reportUnnecessaryContains = "none"
executionEnvironments = [
# zhinst-qcodes is not installable on all Python versions we test
# (no Python 3.15 wheels for zhinst-core yet). When it is installed,
# the Zurich Instruments driver aliases are still typechecked against it.
{ root = "src/qcodes/instrument_drivers/zurich_instruments", reportMissingImports = "none" },
]
[tool.pytest.ini_options]
minversion = "7.2"
testpaths = "tests"
addopts = "-n auto --dist=loadfile --cov-config=pyproject.toml"
asyncio_default_fixture_loop_scope = "function"
markers = "serial"
# we ignore warnings
# triggered by third party packages
# and error on all other warnings
filterwarnings = [
'error',
# DataSet, Experiment and the load_* functions open connections that
# they never close, so these are only closed when garbage collected
'ignore:unclosed database in:ResourceWarning',
'ignore:unclosed\ <socket\.socket:ResourceWarning', # not clear from where this is coming
]
[tool.ruff]
extend-include = ["*.ipynb"]
# tests and docs are not packages so it's
# fine that init is missing and we therefor
# mark them as namespace packages
namespace-packages = ["tests", "docs"]
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
# Enable Pyflakes `E` and `F` codes by default.
# UP pyupgrade
# PT025 invalid use of pytest fixtures in other fixtures
# RUF100 101 Unused and renamed noqa pragmas
# RUF200 validate pyproject.toml
# I isort
# ISC flake8-implicit-str-concat
# TID251 banned-api
# TID253 banned-module-level-imports
# W pydocstyle
# PLx pylint
extend-select = [
"E", "F", "PT025", "UP", "RUF", "YTT", "INP",
"I", "G", "ISC", "TID251", "TID253", "NPY", "PLE",
"PLR", "PLC", "PLW", "W",
"D214", "D300", "D402", "D403", "D405", "D410", "D411", "D412", "D413", "D414", "D416", "D417", "D418", "D419",
"TC", "PYI",
"PGH",
"RUF027", # these are preview rules that are not yet stable but explicitly enabled.
]
# G004 We have a lot of use of f strings in log messages
# so disable that lint for now
# PLxxxx are pylint lints that generate a fair amount of warnings
# it may be worth fixing some or these in the future
# PYI036 disable until https://github.com/astral-sh/ruff/issues/9794 is fixed
ignore = ["E501", "G004", "PLR2004", "PLR0913", "PLR0911", "PLR0912", "PLR0915", "PLW0602", "PLW0603", "PLW2901", "PYI036", "PLR0917"]
# we want to explicitly use the micro symbol
# not the greek letter
allowed-confusables = ["µ"]
[tool.ruff.lint.isort]
known-first-party = ["qcodes"]
[tool.ruff.lint.per-file-ignores]
# TID253 these imports are fine at module level
# in tests and examples
# BLE001 the example notebooks deliberately catch broad exceptions
# to demonstrate that an operation is rejected by QCoDeS
"docs/*" = ["TID253", "BLE001"]
"tests/*" = ["TID253"]
[tool.ruff.lint.flake8-tidy-imports]
# There modules are relatively slow to import
# and only required in specific places so
# don't import them at module level
banned-module-level-imports = [
"xarray", "cf_xarray","pandas", "opencensus", "tqdm.dask", "dask",
"matplotlib", "IPython", "ruamel", "tabulate", "h5netcdf", "PIL", "qcodes_loop"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"typing.ParamSpec".msg = "Use PEP 695 parameter syntax unless a default value requires typing_extensions.ParamSpec."
"typing.TypeVar".msg = "Use PEP 695 type parameter syntax unless a default value requires typing_extensions.TypeVar."
[tool.ruff.lint.pep8-naming]
# N999 (invalid-module-name): these instrument driver modules are part of
# the public qcodes namespace so they cannot be renamed to lower case
# without breaking user code. New modules should use lower case names.
extend-ignore-names = [
"_Agilent_344xxA",
"_AimTTi_PL_P",
"_Keithley_2600",
"_Keysight_N5232B",
"_M5065",
"_M5180",
"_M5xxx",
"_TM620",
"Agilent_34401A",
"Agilent_34410A",
"Agilent_34411A",
"Agilent_E8257D",
"Agilent_E8267C",
"Aim_TTi_PL068_P",
"Aim_TTi_PL155_P",
"Aim_TTi_PL303_P",
"Aim_TTi_PL303QMD_P",
"Aim_TTi_PL303QMT_P",
"Aim_TTi_PL601_P",
"Aim_TTi_QL355_TP",
"AMI430_visa",
"ATS",
"ATS_acquisition_controllers",
"ATS9360",
"ATS9373",
"ATS9440",
"ATS9870",
"AWG5014",
"AWG5208",
"AWG70000A",
"AWG70002A",
"AWGFileParser",
"Base_SPDT",
"BaselSP983",
"BaselSP983a",
"BaselSP983c",
"Decadac",
"DP8xx",
"DPO7200xx",
"DynaCool",
"HP_8133A",
"HP_83650A",
"HP_8753D",
"Infiniium",
"Ithaco_1211",
"Keithley_2000",
"Keithley_2400",
"Keithley_2450",
"Keithley_2601B",
"Keithley_2602A",
"Keithley_2602B",
"Keithley_2604B",
"Keithley_2611B",
"Keithley_2612B",
"Keithley_2614B",
"Keithley_2634B",
"Keithley_2635B",
"Keithley_2636B",
"Keithley_3706A",
"Keithley_6500",
"Keithley_7510",
"Keithley_s46",
"Keysight_33210a",
"Keysight_33250a",
"Keysight_33510b",
"Keysight_33511b",
"Keysight_33512b",
"Keysight_33521b",
"Keysight_33522b",
"Keysight_33611a",
"Keysight_33612a",
"Keysight_33621a",
"Keysight_33622a",
"Keysight_34410A_submodules",
"Keysight_34411A_submodules",
"Keysight_34460A_submodules",
"Keysight_34461A_submodules",
"Keysight_34465A_submodules",
"Keysight_34470A_submodules",
"Keysight_344xxA_submodules",
"Keysight_B2962A",
"Keysight_N5173B",
"Keysight_N5183B",
"Keysight_N5222B",
"Keysight_N5230C",
"Keysight_N5245A",
"Keysight_N6705B",
"Keysight_N9030B",
"Keysight_P5002B",
"Keysight_P5004B",
"Keysight_P9374A",
"KeysightAgilent_33XXX",
"KeysightB1500_base",
"KeysightB1500_module",
"KeysightB1500_sampling_measurement",
"KeysightB1511B",
"KeysightB1517A",
"KeysightB1520A",
"KeysightB1530A",
"KtM960x",
"KtM960xDefs",
"KtMAwg",
"KtMAwgDefs",
"Lakeshore_model_325",
"Lakeshore_model_336",
"Lakeshore_model_372",
"MercuryiPS_VISA",
"N51x1",
"N52xx",
"QDac_channels",
"Rigol_DG1062",
"Rigol_DG4000",
"Rigol_DP821",
"Rigol_DP831",
"Rigol_DP832",
"Rigol_DS1074Z",
"Rigol_DS4000",
"Rohde_Schwarz_ZNB20",
"Rohde_Schwarz_ZNB8",
"RTO1000",
"SG384",
"SGS100A",
"SignalHound_USB_SA124B",
"SR560",
"SR830",
"SR860",
"SR865",
"SR865A",
"SR86x",
"Tektronix_70001A",
"Tektronix_70001B",
"Tektronix_70002B",
"Tektronix_DPO5000",
"Tektronix_DPO7000",
"Tektronix_DPO70000",
"Tektronix_DSA70000",
"Tektronix_MSO5000",
"Tektronix_MSO70000",
"TPS2012",
"USBHIDMixin",
"Weinschel_8320",
"Yokogawa_GS200",
"ZNB",
"ZNB20",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-type-checking]
quote-annotations = true
[tool.setuptools.cmdclass]
sdist = "versioningit.cmdclass.sdist"
build_py = "versioningit.cmdclass.build_py"
[tool.towncrier]
package = "qcodes"
name = "QCoDeS"
directory = "docs/changes/newsfragments"
single_file = false
filename = "docs/changes/{version}.rst"
issue_format = ":pr:`{issue}`"
[tool.towncrier.fragment.breaking]
name = "Breaking Changes:"
[tool.towncrier.fragment.new]
name = "New:"
[tool.towncrier.fragment.improved]
name = "Improved:"
[tool.towncrier.fragment.new_driver]
name = "New Drivers:"
[tool.towncrier.fragment.improved_driver]
name = "Improved Drivers:"
[tool.towncrier.fragment.underthehood]
name = "Under the hood:"
[tool.versioningit]
# we hard code the default version to match a development version
# due to
# https://github.com/orgs/community/discussions/163397#discussioncomment-13888710
default-version = "0.54.0dev+Unknown"
[tool.versioningit.format]
distance = "{next_version}.dev{distance}+{branch}.{vcs}{rev}"
dirty = "{next_version}.dev{distance}+{branch}.{vcs}{rev}.dirty"
distance-dirty = "{next_version}.dev{distance}+{branch}.{vcs}{rev}.dirty"
[tool.versioningit.vcs]
method = "git"
match = ["v*"]
[tool.versioningit.onbuild]
source-file = "src/qcodes/_version.py"
build-file = "qcodes/_version.py"