2022-05-15 11:53:29 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flit-core
|
|
|
|
, astroid
|
|
|
|
, pytestCheckHook
|
|
|
|
, docstring-parser
|
|
|
|
, marshmallow
|
|
|
|
, sphinx
|
|
|
|
, hypothesis
|
|
|
|
, vaa
|
|
|
|
, deal-solver
|
|
|
|
, pygments
|
|
|
|
, typeguard
|
|
|
|
, urllib3
|
2022-09-09 14:54:43 +00:00
|
|
|
, flake8
|
2022-05-15 11:53:29 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "deal";
|
2023-12-02 23:00:18 +00:00
|
|
|
version = "4.24.3";
|
2022-05-15 11:53:29 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "life4";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
2023-12-02 23:00:18 +00:00
|
|
|
hash = "sha256-QlM3d/jmg6v3L3D45+cgcCej71U1dl4uZ6sAYGGm3tU=";
|
2022-05-15 11:53:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# don't do coverage
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "\"--cov-fail-under=100\"," "" \
|
|
|
|
--replace "\"--cov=deal\"," "" \
|
|
|
|
--replace "\"--cov-report=html\"," "" \
|
|
|
|
--replace "\"--cov-report=term-missing:skip-covered\"," ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
astroid
|
|
|
|
deal-solver
|
|
|
|
pygments
|
|
|
|
typeguard
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-05-15 11:53:29 +00:00
|
|
|
pytestCheckHook
|
|
|
|
|
|
|
|
docstring-parser
|
|
|
|
marshmallow
|
|
|
|
sphinx
|
|
|
|
hypothesis
|
|
|
|
vaa
|
|
|
|
urllib3
|
2022-09-09 14:54:43 +00:00
|
|
|
flake8
|
2022-05-15 11:53:29 +00:00
|
|
|
];
|
|
|
|
|
2024-03-17 18:29:52 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W" "ignore::pytest.PytestRemovedIn8Warning"
|
|
|
|
];
|
|
|
|
|
2022-05-15 11:53:29 +00:00
|
|
|
disabledTests = [
|
|
|
|
# needs internet access
|
|
|
|
"test_smoke_has"
|
|
|
|
"test_pure_offline"
|
|
|
|
"test_raises_doesnt_override_another_contract"
|
|
|
|
"test_raises_doesnt_override_another_contract_async"
|
|
|
|
"test_raises_generator"
|
|
|
|
# AttributeError: module 'vaa' has no attribute 'Error'
|
|
|
|
"test_source_vaa_scheme"
|
|
|
|
"test_vaa_scheme_and_custom_exception"
|
|
|
|
"test_scheme_string_validation_args_correct"
|
|
|
|
"test_method_chain_decorator_with_scheme_is_fulfilled"
|
|
|
|
"test_scheme_contract_is_satisfied_when_setting_arg"
|
|
|
|
"test_scheme_contract_is_satisfied_within_chain"
|
|
|
|
"test_scheme_errors_rewrite_message"
|
2023-10-31 20:06:09 +00:00
|
|
|
# assert errors
|
|
|
|
"test_doctest"
|
|
|
|
"test_no_violations"
|
2022-05-15 11:53:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# needs internet access
|
|
|
|
"tests/test_runtime/test_offline.py"
|
2023-10-31 20:06:09 +00:00
|
|
|
# depends on typeguard <4.0.0 for tests, but >=4.0.0 seems fine for runtime
|
|
|
|
# https://github.com/life4/deal/blob/9be70fa1c5a0635880619b2cea83a9f6631eb236/pyproject.toml#L40
|
|
|
|
"tests/test_testing.py"
|
2022-05-15 11:53:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "deal" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for design by contract (DbC) and checking values, exceptions, and side-effects";
|
|
|
|
longDescription = ''
|
|
|
|
In a nutshell, deal empowers you to write bug-free code.
|
|
|
|
By adding a few decorators to your code, you get for free tests, static analysis, formal verification, and much more
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/life4/deal";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ gador ];
|
|
|
|
};
|
|
|
|
}
|