2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
hypothesis,
|
|
|
|
lark,
|
|
|
|
libcst,
|
|
|
|
parso,
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-xdist,
|
|
|
|
pythonOlder,
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hypothesmith";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.3.3";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-lsFIAtbI6F2JdSZBdoeNtUso0u2SH9v+3C5rjOPIFxY=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [ ./remove-black.patch ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
postPatch = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "lark-parser" "lark"
|
|
|
|
|
|
|
|
substituteInPlace tox.ini \
|
|
|
|
--replace "--cov=hypothesmith" "" \
|
|
|
|
--replace "--cov-branch" "" \
|
|
|
|
--replace "--cov-report=term-missing:skip-covered" "" \
|
|
|
|
--replace "--cov-fail-under=100" ""
|
2022-03-05 16:20:37 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
hypothesis
|
|
|
|
lark
|
|
|
|
libcst
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
parso
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "-v" ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/Zac-HD/hypothesmith/issues/21
|
|
|
|
"test_source_code_from_libcst_node_type"
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# missing blib2to3
|
|
|
|
"tests/test_syntactic.py"
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
pythonImportsCheck = [ "hypothesmith" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Hypothesis strategies for generating Python programs, something like CSmith";
|
|
|
|
homepage = "https://github.com/Zac-HD/hypothesmith";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/Zac-HD/hypothesmith/blob/master/CHANGELOG.md";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.mpl20;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|