2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, astor
|
2022-11-04 12:27:35 +00:00
|
|
|
, asttokens
|
2022-06-16 17:23:12 +00:00
|
|
|
, asyncstdlib
|
2022-09-09 14:08:57 +00:00
|
|
|
, deal
|
2022-11-04 12:27:35 +00:00
|
|
|
, dpcontracts
|
|
|
|
, numpy
|
|
|
|
, pytestCheckHook
|
|
|
|
, typing-extensions
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "icontract";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "2.6.4";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Parquery";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-zuaS9mmq47hUIBObYRuzEYQQdTArFXR3TpK9nfZt/yk=";
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
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
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "icontract" ];
|
|
|
|
|
|
|
|
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;
|
2022-11-04 12:27:35 +00:00
|
|
|
maintainers = with maintainers; [ gador thiagokokada ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|