2022-05-15 13:53:29 +02:00
|
|
|
{ lib
|
2024-03-28 09:07:27 +01:00
|
|
|
, astroid
|
2022-05-15 13:53:29 +02:00
|
|
|
, buildPythonPackage
|
2024-03-28 09:07:27 +01:00
|
|
|
, deal-solver
|
|
|
|
, docstring-parser
|
2022-05-15 13:53:29 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, flit-core
|
|
|
|
, hypothesis
|
2024-03-28 09:07:27 +01:00
|
|
|
, marshmallow
|
2022-05-15 13:53:29 +02:00
|
|
|
, pygments
|
2024-03-28 09:07:27 +01:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, sphinx
|
2022-05-15 13:53:29 +02:00
|
|
|
, typeguard
|
|
|
|
, urllib3
|
2024-03-28 09:07:27 +01:00
|
|
|
, vaa
|
2022-05-15 13:53:29 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "deal";
|
2024-03-24 20:40:01 +01:00
|
|
|
version = "4.24.4";
|
2024-03-28 09:07:27 +01:00
|
|
|
pyproject = true;
|
|
|
|
|
2022-05-15 13:53:29 +02:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "life4";
|
2024-03-28 09:07:27 +01:00
|
|
|
repo = "deal";
|
2022-05-15 13:53:29 +02:00
|
|
|
rev = "refs/tags/${version}";
|
2024-03-24 20:40:01 +01:00
|
|
|
hash = "sha256-4orpoYfPGSvquhg9w63uUe8QbBa2RUpxaEJ9uy28+fU=";
|
2022-05-15 13:53:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# don't do coverage
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-03-28 09:07:27 +01:00
|
|
|
--replace-fail '"--cov-fail-under=100",' "" \
|
|
|
|
--replace-fail '"--cov=deal",' "" \
|
|
|
|
--replace-fail '"--cov-report=html",' "" \
|
|
|
|
--replace-fail '"--cov-report=term-missing:skip-covered",' ""
|
2022-05-15 13:53:29 +02:00
|
|
|
'';
|
|
|
|
|
2024-03-28 09:07:27 +01:00
|
|
|
build-system = [
|
2022-05-15 13:53:29 +02:00
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2024-03-28 09:07:27 +01:00
|
|
|
dependencies = [
|
2022-05-15 13:53:29 +02:00
|
|
|
astroid
|
|
|
|
deal-solver
|
|
|
|
pygments
|
|
|
|
typeguard
|
|
|
|
];
|
|
|
|
|
2023-01-21 13:00:00 +01:00
|
|
|
nativeCheckInputs = [
|
2022-05-15 13:53:29 +02:00
|
|
|
docstring-parser
|
2024-03-28 09:07:27 +01:00
|
|
|
hypothesis
|
2022-05-15 13:53:29 +02:00
|
|
|
marshmallow
|
2024-03-28 09:07:27 +01:00
|
|
|
pytestCheckHook
|
2022-05-15 13:53:29 +02:00
|
|
|
sphinx
|
|
|
|
urllib3
|
2024-03-28 09:07:27 +01:00
|
|
|
vaa
|
2022-05-15 13:53:29 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2024-03-28 09:07:27 +01:00
|
|
|
# Tests need internet access
|
2022-05-15 13:53:29 +02:00
|
|
|
"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 21:06:09 +01:00
|
|
|
# assert errors
|
|
|
|
"test_doctest"
|
|
|
|
"test_no_violations"
|
2024-03-28 09:07:27 +01:00
|
|
|
"test_source_get_lambda_multiline_splitted_dec"
|
2022-05-15 13:53:29 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2024-03-28 09:07:27 +01:00
|
|
|
# Test needs internet access
|
2022-05-15 13:53:29 +02:00
|
|
|
"tests/test_runtime/test_offline.py"
|
2023-10-31 21:06:09 +01: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 13:53:29 +02:00
|
|
|
];
|
|
|
|
|
2024-03-28 09:07:27 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"deal"
|
|
|
|
];
|
2022-05-15 13:53:29 +02:00
|
|
|
|
|
|
|
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.
|
2024-03-28 09:07:27 +01:00
|
|
|
By adding a few decorators to your code, you get for free tests, static analysis, formal verification,
|
|
|
|
and much more.
|
2022-05-15 13:53:29 +02:00
|
|
|
'';
|
|
|
|
homepage = "https://github.com/life4/deal";
|
2024-03-28 09:07:27 +01:00
|
|
|
changelog = "https://github.com/life4/deal/releases/tag/${version}";
|
2022-05-15 13:53:29 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ gador ];
|
|
|
|
};
|
|
|
|
}
|