python310Packages.python-daemon: add patches and switch to pytestCheckHook

This commit is contained in:
Fabian Affolter 2022-01-12 14:37:47 +01:00
parent e8c09c51f8
commit d12672ecaa

View File

@ -3,16 +3,21 @@
, fetchPypi
, docutils
, lockfile
, mock
, pytest_4
, pytestCheckHook
, testscenarios
, testtools
, twine
, python
, pythonOlder
, fetchpatch
}:
buildPythonPackage rec {
pname = "python-daemon";
version = "2.3.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
@ -29,22 +34,39 @@ buildPythonPackage rec {
];
checkInputs = [
pytest_4
mock
pytestCheckHook
testscenarios
testtools
];
# tests disabled due to incompatibilities with testtools>=2.5.0
checkPhase = ''
runHook preCheck
pytest -k ' \
not detaches_process_context and \
not standard_stream_file_descriptors and \
not test_module_has_attribute and \
not test_module_attribute_has_duck_type'
runHook postCheck
'';
patches = [
# Should be fixed in the next release
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/python-daemon/raw/rawhide/f/python-daemon-safe_hasattr.patch";
sha256 = "sha256-p5epAlM/sdel01oZkSI1vahUZYX8r90WCJuvBnfMaus=";
})
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/python-daemon/raw/rawhide/f/tests-remove-duplicate-mocking.patch";
sha256 = "sha256-5b/dFR3Z8xaPw8AZU95apDZd4ZfmMQhAmavWkVaJog8=";
})
];
disabledTests = [
"begin_with_TestCase"
"changelog_TestCase"
"ChangeLogEntry"
"DaemonContext"
"file_descriptor"
"get_distribution_version_info_TestCase"
"InvalidFormatError_TestCase"
"make_year_range_TestCase"
"ModuleExceptions_TestCase"
"test_metaclass_not_called"
"test_passes_specified_object"
"test_returns_expected"
"value_TestCase"
"YearRange_TestCase"
];
pythonImportsCheck = [
"daemon"
@ -56,10 +78,8 @@ buildPythonPackage rec {
meta = with lib; {
description = "Library to implement a well-behaved Unix daemon process";
homepage = "https://pagure.io/python-daemon/";
license = with licenses; [
gpl3Plus
asl20
];
# See "Copying" section in https://pagure.io/python-daemon/blob/main/f/README
license = with licenses; [ gpl3Plus asl20 ];
maintainers = with maintainers; [ ];
};
}