2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, hypothesis
|
|
|
|
, lark
|
|
|
|
, libcst
|
|
|
|
, parso
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
2023-10-09 19:29:22 +00:00
|
|
|
, 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
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
./remove-black.patch
|
|
|
|
];
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
propagatedBuildInputs = [ hypothesis lark libcst ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ parso pytestCheckHook pytest-xdist ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +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;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|