1{ stdenv, fetchPypi, buildPythonPackage, service-identity, requests, six
2, mock, twisted, incremental, pep8, httpbin
3}:
4
5buildPythonPackage rec {
6 pname = "treq";
7 version = "18.6.0";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "91e09ff6b524cc90aa5e934b909c8d0d1a9d36ebd618b6c38e37b17013e69f48";
12 };
13
14 propagatedBuildInputs = [
15 requests
16 six
17 incremental
18 service-identity
19 twisted
20 # twisted [tls] requirements (we should find a way to list "extras")
21 twisted.extras.tls
22 ];
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 stdenv.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; [ nand0p ];
55 };
56}