From 50b0e5bfa1ab09a366d575fea1915a3f4002eb68 Mon Sep 17 00:00:00 2001 From: Fernando J Pando Date: Mon, 29 May 2017 20:22:50 -0400 Subject: [PATCH] treq: 17.3.1 - enables and fixes tests - makes docs properly - used fetchpypi - tested nixos python 27/34 --- .../python-modules/treq/default.nix | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/treq/default.nix b/pkgs/development/python-modules/treq/default.nix index ede5f2520c19..b22ee2675a72 100644 --- a/pkgs/development/python-modules/treq/default.nix +++ b/pkgs/development/python-modules/treq/default.nix @@ -1,23 +1,17 @@ -{ stdenv, fetchurl, buildPythonPackage, service-identity, requests, - six, mock, twisted, incremental, coreutils, gnumake, pep8, sphinx, - openssl, pyopenssl }: +{ stdenv, fetchPypi, buildPythonPackage, service-identity, requests, six, + mock, twisted, incremental, pep8, sphinx, openssl, pyopenssl, tox }: buildPythonPackage rec { name = "${pname}-${version}"; pname = "treq"; version = "17.3.1"; - src = fetchurl { - url = "mirror://pypi/t/${pname}/${name}.tar.gz"; - sha256 = "313af6dedecfdde2750968dc17653b6147cf2340b3479d70031cf741f5be0cf6"; + src = fetchPypi { + inherit pname version; + sha256 = "1xhcpvsl3xqw0dq9sixk80iwyiv17djigp3815sy5pfgvvggcfii"; }; buildInputs = [ - pep8 - mock - ]; - - propagatedBuildInputs = [ service-identity requests twisted @@ -26,22 +20,30 @@ buildPythonPackage rec { six openssl pyopenssl + tox ]; + checkInputs = [ + pep8 + mock + ]; + + postPatch = '' + rm -fv src/treq/test/test_treq_integration.py + ''; + + postBuild = '' + # build documentation and install in $out + tox -e docs + mkdir -pv $out/docs + cp -rv docs/* $out/docs/ + ''; + checkPhase = '' ${pep8}/bin/pep8 --ignore=E902 treq trial treq ''; - doCheck = false; - # Failure: twisted.web._newclient.RequestTransmissionFailed: [] - - postBuild = '' - ${coreutils}/bin/mkdir -pv treq - ${coreutils}/bin/echo "${version}" | ${coreutils}/bin/tee treq/_version - cd docs && ${gnumake}/bin/make html && cd .. - ''; - meta = with stdenv.lib; { homepage = http://github.com/twisted/treq; description = "A requests-like API built on top of twisted.web's Agent";