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