nixpkgs/pkgs/development/python-modules/qcodes/default.nix

216 lines
4.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
versioningit,
# dependencies
broadbean,
cf-xarray,
dask,
h5netcdf,
h5py,
ipykernel,
ipywidgets,
jsonschema,
libcst,
matplotlib,
networkx,
numpy,
opentelemetry-api,
packaging,
pandas,
pillow,
pyarrow,
pyvisa,
ruamel-yaml,
tabulate,
tqdm,
typing-extensions,
uncertainties,
websockets,
xarray,
# optional-dependencies
furo,
nbsphinx,
pyvisa-sim,
scipy,
sphinx,
sphinx-issues,
towncrier,
# tests
deepdiff,
hypothesis,
lxml,
pip,
pytest-asyncio,
pytest-cov-stub,
pytest-mock,
pytest-rerunfailures,
pytest-xdist,
pytestCheckHook,
writableTmpDirAsHomeHook,
}:
buildPythonPackage (finalAttrs: {
pname = "qcodes";
version = "0.54.4";
pyproject = true;
src = fetchFromGitHub {
owner = "microsoft";
repo = "Qcodes";
tag = "v${finalAttrs.version}";
hash = "sha256-xiD/Iy/5FVadOc9/AxUbGgpOlyli2g6/hwpY1J3/urE=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail \
'default-version = "0.54.0dev+Unknown"' \
'default-version = "${finalAttrs.version}"'
'';
build-system = [
setuptools
versioningit
];
dependencies = [
broadbean
cf-xarray
dask
h5netcdf
h5py
ipykernel
ipywidgets
jsonschema
matplotlib
networkx
numpy
opentelemetry-api
packaging
pandas
pillow
pyarrow
pyvisa
ruamel-yaml
tabulate
tqdm
typing-extensions
uncertainties
websockets
xarray
];
optional-dependencies = {
docs = [
# autodocsumm
furo
nbsphinx
pyvisa-sim
# qcodes-loop
scipy
sphinx
# sphinx-favicon
sphinx-issues
# sphinx-jsonschema
# sphinxcontrib-towncrier
towncrier
];
loop = [
# qcodes-loop
];
refactor = [
libcst
];
zurichinstruments = [
# zhinst-qcodes
];
};
nativeCheckInputs = [
deepdiff
hypothesis
libcst
lxml
pip
pytest-asyncio
pytest-cov-stub
pytest-mock
pytest-rerunfailures
pytest-xdist
pytestCheckHook
pyvisa-sim
sphinx
writableTmpDirAsHomeHook
];
__darwinAllowLocalNetworking = true;
pytestFlags = [
"-v"
"--hypothesis-profile ci"
# Follow upstream with settings
"--durations=20"
# ERROR tests/test_interactive_widget.py - DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
# given by the platformdirs library. To remove this warning and
# see the appropriate new directories, set the environment variable
# `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
# The use of platformdirs will be the default in `jupyter_core` v6
"-Wignore::DeprecationWarning"
];
disabledTestPaths = [
# Test depends on qcodes-loop, causing a cyclic dependency
"tests/dataset/measurement/test_load_legacy_data.py"
# TypeError
"tests/dataset/test_dataset_basic.py"
];
disabledTestMarks = [
"serial"
];
disabledTests = [
# Tests are time-sensitive and power-consuming
# Those tests fails repeatably and are flaky
"test_access_channels_by_name"
"test_access_channels_by_slice"
"test_access_channels_by_tuple"
"test_aggregator"
"test_datasaver"
"test_do1d_additional_setpoints_shape"
"test_dond_1d_additional_setpoints_shape"
"test_field_limits"
"test_get_array_in_scalar_param_data"
"test_get_parameter_data"
"test_measured"
"test_ramp_safely"
"test_ramp_scaled"
# more flaky tests
# https://github.com/microsoft/Qcodes/issues/5551
"test_query_close_once_at_init"
"test_step_ramp"
];
pythonImportsCheck = [ "qcodes" ];
meta = {
description = "Python-based data acquisition framework";
changelog = "https://github.com/QCoDeS/Qcodes/releases/tag/${finalAttrs.src.tag}";
downloadPage = "https://github.com/QCoDeS/Qcodes";
homepage = "https://qcodes.github.io/Qcodes/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
GaetanLepage
];
};
})