2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, hypothesis
|
|
|
|
, lark
|
|
|
|
, libcst
|
|
|
|
, parso
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
|
|
|
}:
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hypothesmith";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "0.2.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "0fb7b3fd03d76eddd4474b0561e1c2662457593a74cc300fd27e5409cd4d7922";
|
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
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
checkInputs = [ 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
|
|
|
];
|
|
|
|
|
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";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
|
|
|
};
|
|
|
|
}
|