Merge #187778: python3Packages: test fixes after unittestCheckHook

...into staging-next
This commit is contained in:
Vladimír Čunát 2022-08-24 17:08:44 +02:00
commit 4b41fffbb9
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
2 changed files with 23 additions and 16 deletions

View file

@ -2,32 +2,30 @@
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, cython , cython
, unittestCheckHook , pytestCheckHook
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "cymem"; pname = "cymem";
version = "2.0.3"; version = "2.0.6";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "explosion"; owner = "explosion";
repo = "cymem"; repo = "cymem";
rev = "v${version}"; rev = "v${version}";
sha256 = "0cqz6whq4zginxjnh4cfqlsh535p4qz295ymvjchp71fv8mz11f6"; sha256 = "sha256-o+44v6wvE9HxeQaDDQ0+gi7z1V7jtkZvWglY8UyVHLg=";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
cython cython
]; ];
prePatch = '' # ModuleNotFoundError: No module named 'cymem.cymem'
substituteInPlace setup.py \ doCheck = false;
--replace "wheel>=0.32.0,<0.33.0" "wheel>=0.31.0"
'';
checkInputs = [ unittestCheckHook ]; checkInputs = [ pytestCheckHook ];
unittestFlagsArray = [ "-s" "cymem/tests" "-p" "*test*" ]; pytestFlagsArray = [ "cymem" ];
meta = with lib; { meta = with lib; {
description = "Cython memory pool for RAII-style memory management"; description = "Cython memory pool for RAII-style memory management";

View file

@ -1,7 +1,7 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchFromGitHub
, unittestCheckHook , python
, pythonOlder , pythonOlder
}: }:
@ -12,14 +12,23 @@ buildPythonPackage rec {
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "ialbert";
hash = "sha256-OL3YZNBFD7dIGTqoF7nEWKj1MZ+/l7ImEVHPwKWBIJA="; repo = pname;
rev = "v${version}";
hash = "sha256-U3k97YJhQjulYNWcKVx96/5zND5VfsRjA3ZZHWhcDNg=";
}; };
checkInputs = [ unittestCheckHook ]; # tests are broken, see https://github.com/ialbert/plac/issues/74
doCheck = false;
unittestFlagsArray = [ "-s" "doc" "-p" "*test_plac*" ]; checkPhase = ''
runHook preCheck
${python.interpreter} doc/test_plac.py
runHook postCheck
'';
pythonImportsCheck = [ pythonImportsCheck = [
"plac" "plac"