From 6c5049e54ae5e7b19d43dc259c418d675c0f7638 Mon Sep 17 00:00:00 2001 From: Ilya Elenskiy Date: Sat, 13 May 2023 00:37:58 +0200 Subject: [PATCH] python3Packages.qcodes: init at 0.38.1 --- .../python-modules/qcodes-loop/default.nix | 87 ++++++++++++ .../python-modules/qcodes/default.nix | 133 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 + 3 files changed, 224 insertions(+) create mode 100644 pkgs/development/python-modules/qcodes-loop/default.nix create mode 100644 pkgs/development/python-modules/qcodes/default.nix diff --git a/pkgs/development/python-modules/qcodes-loop/default.nix b/pkgs/development/python-modules/qcodes-loop/default.nix new file mode 100644 index 000000000000..ef65af007d90 --- /dev/null +++ b/pkgs/development/python-modules/qcodes-loop/default.nix @@ -0,0 +1,87 @@ +{ lib +, fetchPypi +, pythonOlder +, buildPythonPackage +, qcodes +, h5py +, lazy-loader +, matplotlib +, numpy +, pandas +, versioningit +, xarray +, hickle +, ipython +, slack-sdk +, hypothesis +, pytest-xdist +, pytest-mock +, pyqtgraph +, pyqt5 +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "qcodes-loop"; + version = "0.1.1"; + + disabled = pythonOlder "3.8"; + format = "pyproject"; + + src = fetchPypi { + inherit version; + pname = "qcodes_loop"; + sha256 = "sha256-pDR0Ws8cYQifftdE9dKcSzMxmouFo4tJmQvNanm6zyM="; + }; + + nativeBuildInputs = [ + versioningit + ]; + + propagatedBuildInputs = [ + qcodes + h5py + lazy-loader + matplotlib + numpy + pandas + xarray + hickle + ipython + ]; + + passthru.optional-dependencies = { + qtplot = [ + pyqtgraph + ]; + slack = [ + slack-sdk + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + hypothesis + pytest-xdist + pytest-mock + pyqt5 + ]; + + pythonImportsCheck = [ "qcodes_loop" ]; + + disabledTestPaths = [ + # test broken in 0.1.1, see https://github.com/QCoDeS/Qcodes_loop/pull/25 + "src/qcodes_loop/tests/test_hdf5formatter.py" + ]; + + postInstall = '' + export HOME="$TMPDIR" + ''; + + meta = with lib; { + description = "Features previously in QCoDeS"; + homepage = "https://github.com/QCoDeS/Qcodes_loop"; + license = licenses.mit; + maintainers = with maintainers; [ evilmav ]; + }; +} diff --git a/pkgs/development/python-modules/qcodes/default.nix b/pkgs/development/python-modules/qcodes/default.nix new file mode 100644 index 000000000000..46e39fc4fcf8 --- /dev/null +++ b/pkgs/development/python-modules/qcodes/default.nix @@ -0,0 +1,133 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, setuptools +, versioningit + + # mandatory +, broadbean +, h5netcdf +, h5py +, importlib-metadata +, importlib-resources +, ipywidgets +, ipykernel +, jsonschema +, matplotlib +, numpy +, opencensus +, opencensus-ext-azure +, packaging +, pandas +, pyvisa +, ruamel-yaml +, tabulate +, typing-extensions +, tqdm +, uncertainties +, websockets +, wrapt +, xarray +, ipython +, pillow +, rsa + + # optional +, qcodes-loop + + # test +, pytestCheckHook +, deepdiff +, hypothesis +, lxml +, pytest-asyncio +, pytest-mock +, pytest-rerunfailures +, pytest-xdist +, pyvisa-sim +, sphinx +}: + +buildPythonPackage rec { + pname = "qcodes"; + version = "0.38.1"; + + disabled = pythonOlder "3.8"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-whUGkRvYQOdYxWoj7qhv2kiiyTwq3ZLLipI424PBzFg="; + }; + + nativeBuildInputs = [ setuptools versioningit ]; + + propagatedBuildInputs = [ + broadbean + h5netcdf + h5py + ipywidgets + ipykernel + jsonschema + matplotlib + numpy + opencensus + opencensus-ext-azure + packaging + pandas + pyvisa + ruamel-yaml + tabulate + typing-extensions + tqdm + uncertainties + websockets + wrapt + xarray + ipython + pillow + rsa + ] ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ] ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources + ]; + + passthru.optional-dependencies = { + loop = [ + qcodes-loop + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + deepdiff + hypothesis + lxml + pytest-asyncio + pytest-mock + pytest-rerunfailures + pytest-xdist + pyvisa-sim + sphinx + ]; + + disabledTestPaths = [ + # depends on qcodes-loop, causing a cyclic dependency + "qcodes/tests/dataset/measurement/test_load_legacy_data.py" + ]; + + pythonImportsCheck = [ "qcodes" ]; + + postInstall = '' + export HOME="$TMPDIR" + ''; + + meta = { + homepage = "https://qcodes.github.io/Qcodes/"; + description = "Python-based data acquisition framework"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ evilmav ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d07608c8338e..b2d64320c4ac 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10204,6 +10204,10 @@ self: super: with self; { qcengine = callPackage ../development/python-modules/qcengine { }; + qcodes = callPackage ../development/python-modules/qcodes { }; + + qcodes-loop = callPackage ../development/python-modules/qcodes-loop { }; + qcs-api-client = callPackage ../development/python-modules/qcs-api-client { }; qdarkstyle = callPackage ../development/python-modules/qdarkstyle { };