1{
2 lib,
3 anyio,
4 buildPythonPackage,
5 curio,
6 fetchFromGitHub,
7 httpx,
8 hypothesis,
9 poetry-core,
10 pytest-aio,
11 pytest-subtests,
12 pytestCheckHook,
13 pythonOlder,
14 setuptools,
15 trio,
16 typing-extensions,
17}:
18
19buildPythonPackage rec {
20 pname = "returns";
21 version = "0.23.0";
22 format = "pyproject";
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "dry-python";
28 repo = "returns";
29 rev = "refs/tags/${version}";
30 hash = "sha256-4ZP/wvPgqQQec/BaXuL9r7BEc2G+LztMdFul0NeEJTc=";
31 };
32
33 postPatch = ''
34 sed -i setup.cfg \
35 -e '/--cov.*/d' \
36 -e '/--mypy.*/d'
37 '';
38
39 nativeBuildInputs = [ poetry-core ];
40
41 propagatedBuildInputs = [ typing-extensions ];
42
43 nativeCheckInputs = [
44 anyio
45 curio
46 httpx
47 hypothesis
48 pytestCheckHook
49 pytest-aio
50 pytest-subtests
51 setuptools
52 trio
53 ];
54
55 preCheck = ''
56 rm -rf returns/contrib/mypy
57 '';
58
59 pythonImportsCheck = [ "returns" ];
60
61 pytestFlagsArray = [ "--ignore=typesafety" ];
62
63 meta = with lib; {
64 description = "Make your functions return something meaningful, typed, and safe!";
65 homepage = "https://github.com/dry-python/returns";
66 changelog = "https://github.com/dry-python/returns/blob/${version}/CHANGELOG.md";
67 license = licenses.bsd2;
68 maintainers = with maintainers; [ jessemoore ];
69 };
70}