2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
astor,
|
|
|
|
asttokens,
|
|
|
|
asyncstdlib,
|
|
|
|
buildPythonPackage,
|
|
|
|
deal,
|
|
|
|
dpcontracts,
|
|
|
|
fetchFromGitHub,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
typing-extensions,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "icontract";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.7.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Parquery";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "icontract";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-+0h3Zb7lTxtaWTv2/MmvQCcccUKhTOxGqbqKELE8mQY=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# we don't want to use the precommit.py script to build the package.
|
|
|
|
# For the tests to succeed, "ICONTRACT_SLOW" needs to be set.
|
|
|
|
# see https://github.com/Parquery/icontract/blob/aaeb1b06780a34b05743377e4cb2458780e808d3/precommit.py#L57
|
|
|
|
export ICONTRACT_SLOW=1
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
dependencies = [
|
2022-06-16 17:23:12 +00:00
|
|
|
asttokens
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
astor
|
|
|
|
asyncstdlib
|
2022-09-09 14:08:57 +00:00
|
|
|
deal
|
2022-11-04 12:27:35 +00:00
|
|
|
dpcontracts
|
|
|
|
numpy
|
|
|
|
pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTests = [
|
|
|
|
# AssertionError
|
|
|
|
"test_abstract_method_not_implemented"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
disabledTestPaths = [
|
2022-11-04 12:27:35 +00:00
|
|
|
# mypy decorator checks don't pass. For some reason mypy
|
2022-06-16 17:23:12 +00:00
|
|
|
# doesn't check the python file provided in the test.
|
|
|
|
"tests/test_mypy_decorators.py"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Those tests seems to simply re-run some typeguard tests
|
2023-11-16 04:20:00 +00:00
|
|
|
"tests/test_typeguard.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# RuntimeWarning: coroutine '*' was never awaited
|
2024-06-05 15:53:02 +00:00
|
|
|
"-W"
|
|
|
|
"ignore::RuntimeWarning"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "icontract" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Provide design-by-contract with informative violation messages";
|
|
|
|
homepage = "https://github.com/Parquery/icontract";
|
2022-11-04 12:27:35 +00:00
|
|
|
changelog = "https://github.com/Parquery/icontract/blob/v${version}/CHANGELOG.rst";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.mit;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
gador
|
|
|
|
thiagokokada
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|