1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, hypothesis
6, poetry-core
7, pydantic
8, pytest
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "hypothesis-auto";
14 version = "1.1.4";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-XiwvsJ3AmEJRLYBjC7eSNZodM9LARzrUfuI9oL6eMrE=";
22 };
23
24 patches = [
25 (fetchpatch {
26 name = "switch-to-poetry-core.patch";
27 url = "https://github.com/timothycrosley/hypothesis-auto/commit/8277b4232617c0433f80e9c2844452b9fae67a65.patch";
28 hash = "sha256-/0z0nphtQnUBiLYhhzLZT59kQgktSugaBg+ePNxy0qI=";
29 })
30 ];
31
32 postPatch = ''
33 # https://github.com/timothycrosley/hypothesis-auto/pull/20
34 substituteInPlace pyproject.toml \
35 --replace 'pydantic = ">=0.32.2<2.0.0"' 'pydantic = ">=0.32.2, <2.0.0"' \
36 --replace 'hypothesis = ">=4.36<6.0.0"' 'hypothesis = "*"'
37 '';
38
39 nativeBuildInputs = [
40 poetry-core
41 ];
42
43 propagatedBuildInputs = [
44 pydantic
45 hypothesis
46 pytest
47 ];
48
49 pythonImportsCheck = [
50 "hypothesis_auto"
51 ];
52
53 meta = with lib; {
54 description = "Enables fully automatic tests for type annotated functions";
55 homepage = "https://github.com/timothycrosley/hypothesis-auto/";
56 license = licenses.mit;
57 maintainers = with maintainers; [ jonringer ];
58 };
59}