1{ lib
2, buildPythonPackage
3, fetchPypi
4, hypothesis
5, lark
6, libcst
7, parso
8, pytestCheckHook
9, pytest-xdist
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "hypothesmith";
15 version = "0.3.0";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-Uj2gTAY7hzko1sKO8WUGz2S/MXdwOYN+F+a73G4szNs=";
23 };
24
25 patches = [
26 ./remove-black.patch
27 ];
28
29 postPatch = ''
30 substituteInPlace setup.py \
31 --replace "lark-parser" "lark"
32
33 substituteInPlace tox.ini \
34 --replace "--cov=hypothesmith" "" \
35 --replace "--cov-branch" "" \
36 --replace "--cov-report=term-missing:skip-covered" "" \
37 --replace "--cov-fail-under=100" ""
38 '';
39
40 propagatedBuildInputs = [ hypothesis lark libcst ];
41
42 nativeCheckInputs = [ parso pytestCheckHook pytest-xdist ];
43
44 pytestFlagsArray = [
45 "-v"
46 ];
47
48 disabledTests = [
49 # https://github.com/Zac-HD/hypothesmith/issues/21
50 "test_source_code_from_libcst_node_type"
51 ];
52
53 disabledTestPaths = [
54 # missing blib2to3
55 "tests/test_syntactic.py"
56 ];
57
58 pythonImportsCheck = [ "hypothesmith" ];
59
60 meta = with lib; {
61 description = "Hypothesis strategies for generating Python programs, something like CSmith";
62 homepage = "https://github.com/Zac-HD/hypothesmith";
63 changelog = "https://github.com/Zac-HD/hypothesmith/blob/master/CHANGELOG.md";
64 license = licenses.mpl20;
65 maintainers = with maintainers; [ ];
66 };
67}