From c47002498ddafe450ac423109737161c1ef8469f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 17 Oct 2022 09:47:39 +0200 Subject: [PATCH] python310Packages.psygnal: enable tests - add pythonImportsCheck - clean-up inputs - disable on older Python releases --- .../python-modules/psygnal/default.nix | 61 ++++++++++++++----- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/psygnal/default.nix b/pkgs/development/python-modules/psygnal/default.nix index 21fe3aed846d..a62e90a80e71 100644 --- a/pkgs/development/python-modules/psygnal/default.nix +++ b/pkgs/development/python-modules/psygnal/default.nix @@ -1,33 +1,64 @@ { lib , buildPythonPackage , fetchFromGitHub -, wheel -, setuptools -, setuptools-scm -, pytestCheckHook +, importlib-metadata +, numpy +, pydantic , pytest-mypy-plugins -, pytest-cov -, pytest -, mypy +, pytestCheckHook +, pythonOlder +, setuptools-scm , typing-extensions -}: buildPythonPackage rec -{ +, wheel +, wrapt +}: + +buildPythonPackage rec { pname = "psygnal"; version = "0.5.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + src = fetchFromGitHub { owner = "tlambert03"; repo = pname; rev = "refs/tags/v${version}"; - sha256 = "sha256-Hh1HG4VVcNXo62M/4mU3ZcSQNHmalcIDprkwD6/WRf8="; + hash = "sha256-Hh1HG4VVcNXo62M/4mU3ZcSQNHmalcIDprkwD6/WRf8="; }; - buildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ typing-extensions ]; - checkInputs = [ pytestCheckHook pytest-cov pytest-mypy-plugins ]; - doCheck = false; # mypy checks are failing + SETUPTOOLS_SCM_PRETEND_VERSION = version; + buildInputs = [ + setuptools-scm + wheel + ]; + + propagatedBuildInputs = [ + typing-extensions + ] ++ lib.optionals (pythonOlder "3.8") [ + importlib-metadata + ]; + + checkInputs = [ + numpy + pydantic + pytest-mypy-plugins + pytestCheckHook + wrapt + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=psygnal --cov-report=term-missing" "" + ''; + + pythonImportsCheck = [ + "psygnal" + ]; + meta = with lib; { - description = "Pure python implementation of Qt Signals"; + description = "Implementation of Qt Signals"; homepage = "https://github.com/tlambert03/psygnal"; license = licenses.bsd3; maintainers = with maintainers; [ SomeoneSerge ];