python311Packages.nose2: fix build

- Convert to PEP517 build
- Convert to unittestCheckHook
- Disable failing test
- Prune dependencies and expose coverage extra
This commit is contained in:
Martin Weinelt
2023-12-20 20:46:19 +01:00
parent 4cc0c389e0
commit dcdeb74e7e
@@ -1,16 +1,22 @@
{ lib
, buildPythonPackage
, fetchPypi
, python
, six
, pythonOlder
# build-system
, setuptools
# optional-dependencies
, coverage
# tests
, unittestCheckHook
}:
buildPythonPackage rec {
pname = "nose2";
version = "0.14.0";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.8";
@@ -19,21 +25,32 @@ buildPythonPackage rec {
hash = "sha256-XCjXcKC5pwKGK9bDdVuizS95lN1RjJguXOKY1/N0ZqQ=";
};
propagatedBuildInputs = [
coverage
six
nativeBuildInputs = [
setuptools
];
__darwinAllowLocalNetworking = true;
checkPhase = ''
${python.interpreter} -m unittest
'';
passthru.optional-dependencies = {
coverage = [
coverage
];
};
pythonImportsCheck = [
"nose2"
];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
unittestCheckHook
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
preCheck = ''
# https://github.com/nose-devs/nose2/issues/588
substituteInPlace nose2/tests/functional/test_junitxml_plugin.py \
--replace "test_skip_reason_in_message" "dont_test_skip_reason_in_message"
'';
meta = with lib; {
description = "Test runner for Python";
homepage = "https://github.com/nose-devs/nose2";