1{
2 lib,
3 fetchPypi,
4 buildPythonPackage,
5
6 # build-system
7 incremental,
8 setuptools,
9
10 # dependencies
11 attrs,
12 hyperlink,
13 requests,
14 twisted,
15
16 # tests
17 httpbin,
18}:
19
20buildPythonPackage rec {
21 pname = "treq";
22 version = "24.9.1";
23 pyproject = true;
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-Fdp/xATz5O1Z0Kvl+O70lm+rvmGAOaKiO8fBUwXO/qg=";
28 };
29
30 nativeBuildInputs = [
31 incremental
32 setuptools
33 ];
34
35 propagatedBuildInputs = [
36 attrs
37 hyperlink
38 incremental
39 requests
40 twisted
41 ]
42 ++ twisted.optional-dependencies.tls;
43
44 nativeCheckInputs = [
45 httpbin
46 twisted
47 ];
48
49 checkPhase = ''
50 runHook preCheck
51
52 trial treq
53
54 runHook postCheck
55 '';
56
57 meta = with lib; {
58 homepage = "https://github.com/twisted/treq";
59 description = "Requests-like API built on top of twisted.web's Agent";
60 license = licenses.mit;
61 maintainers = [ ];
62 };
63}