Unverified Commit 0d38e14c authored by Nick Cao's avatar Nick Cao
Browse files

python311Packages.pyvisa-py: modernize

parent 068bd654
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
{ 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";