From 0031ccab55e72a1ca59128882f9f98de2a049226 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 7 Jun 2022 10:10:58 +0200 Subject: [PATCH] python310Packages.pyserial: add pythonImportsCheck - disable on obsolete Python releases - add format --- .../python-modules/pyserial/default.nix | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/pyserial/default.nix b/pkgs/development/python-modules/pyserial/default.nix index b45b031fb84a..92ef636932fd 100644 --- a/pkgs/development/python-modules/pyserial/default.nix +++ b/pkgs/development/python-modules/pyserial/default.nix @@ -1,12 +1,21 @@ -{ stdenv, lib, fetchPypi, buildPythonPackage }: +{ lib +, stdenv +, buildPythonPackage +, fetchPypi +, python +, pythonOlder +}: buildPythonPackage rec { pname = "pyserial"; - version="3.5"; + version = "3.5"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "1nyd4m4mnrz8scbfqn4zpq8gnbl4x42w5zz62vcgpzqd2waf0xrw"; + hash = "sha256-PHfgFBcN//vYFub/wgXphC77EL6fWOwW0+hnW0klzds="; }; patches = [ @@ -14,13 +23,22 @@ buildPythonPackage rec { ./002-rfc2217-timeout-setter-for-rfc2217.patch ]; - checkPhase = "python -m unittest discover -s test"; doCheck = !stdenv.hostPlatform.isDarwin; # broken on darwin + checkPhase = '' + runHook preCheck + ${python.interpreter} -m unittest discover -s test + runHook postCheck + ''; + + pythonImportsCheck = [ + "serial" + ]; + meta = with lib; { - homepage = "https://github.com/pyserial/pyserial"; - license = licenses.psfl; description = "Python serial port extension"; + homepage = "https://github.com/pyserial/pyserial"; + license = licenses.bsd3; maintainers = with maintainers; [ makefu ]; }; }