From 0d38e14ce8b6081e24ea8396437d8ec546f09ccb Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 11 Nov 2023 09:13:49 -0500 Subject: [PATCH] python311Packages.pyvisa-py: modernize --- .../python-modules/pyvisa-py/default.nix | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) 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";