1{ lib, fetchPypi, buildPythonPackage, service-identity, requests, six
2, mock, twisted, incremental, pep8, httpbin
3}:
4
5buildPythonPackage rec {
6 pname = "treq";
7 version = "21.5.0";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "02ea86383fc4b57539c45a965eaa1e9fd28302cdf382d21da8430050c97be9b8";
12 };
13
14 propagatedBuildInputs = [
15 requests
16 six
17 incremental
18 service-identity
19 twisted
20 ]
21 # twisted [tls] requirements (we should find a way to list "extras")
22 ++ twisted.extras.tls;
23
24 checkInputs = [
25 pep8
26 mock
27 httpbin
28 ];
29
30 postPatch = ''
31 rm -fv src/treq/test/test_treq_integration.py
32 '';
33
34 # XXX tox tries to install coverage despite it is installed
35 #postBuild = ''
36 # # build documentation and install in $out
37 # tox -e docs
38 # mkdir -pv $out/docs
39 # cp -rv docs/* $out/docs/
40 #'';
41
42 checkPhase = ''
43 pep8 --ignore=E902 treq
44 trial treq
45 '';
46
47 # Failing tests https://github.com/twisted/treq/issues/208
48 doCheck = false;
49
50 meta = with lib; {
51 homepage = "https://github.com/twisted/treq";
52 description = "A requests-like API built on top of twisted.web's Agent";
53 license = licenses.mit;
54 maintainers = with maintainers; [ ];
55 };
56}