diff --git a/pkgs/development/python-modules/pyvisa-py/default.nix b/pkgs/development/python-modules/pyvisa-py/default.nix index 287947c5cf33..626d87b796ae 100644 --- a/pkgs/development/python-modules/pyvisa-py/default.nix +++ b/pkgs/development/python-modules/pyvisa-py/default.nix @@ -1,11 +1,15 @@ { lib , fetchFromGitHub , buildPythonPackage +, setuptools , setuptools-scm +, gpib-ctypes , pyserial , pyusb , pyvisa , typing-extensions +, psutil +, zeroconf , pytestCheckHook , pythonOlder }: @@ -13,9 +17,9 @@ buildPythonPackage rec { pname = "pyvisa-py"; version = "0.7.1"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "pyvisa"; @@ -25,23 +29,29 @@ buildPythonPackage rec { }; nativeBuildInputs = [ + setuptools setuptools-scm ]; propagatedBuildInputs = [ - pyserial - pyusb pyvisa typing-extensions ]; + passthru.optional-dependencies = { + gpib-ctypes = [ gpib-ctypes ]; + serial = [ pyserial ]; + usb = [ pyusb ]; + psutil = [ psutil ]; + hislip-discovery = [ zeroconf ]; + # vicp = [ pyvicp zeroconf ]; + }; + nativeCheckInputs = [ pytestCheckHook ]; - postConfigure = '' - export SETUPTOOLS_SCM_PRETEND_VERSION="v${version}" - ''; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; meta = with lib; { description = "Module that implements the Virtual Instrument Software Architecture";