python.pkgs.agate: fix tests

Need to use fetchFromGitHub because examples/ is missing from PyPI tarball.
Also clean up the expression and specify appropriate checkInputs.
Fixes #42867.
This commit is contained in:
Robert Schütz 2018-07-06 16:18:22 +02:00
parent 38bca8d36f
commit fda46a645c

View File

@ -1,23 +1,34 @@
{ stdenv, fetchPypi, buildPythonPackage, isPy3k, { lib, fetchFromGitHub, buildPythonPackage, isPy3k
discid, six, parsedatetime, isodate, Babel, pytimeparse, , six, pytimeparse, parsedatetime, Babel
leather, python-slugify }: , isodate, python-slugify, leather
, glibcLocales, nose, lxml, cssselect, unittest2 }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "agate"; pname = "agate";
version = "1.6.1"; version = "1.6.1";
src = fetchPypi { # PyPI tarball does not include all test files
inherit pname version; # https://github.com/wireservice/agate/pull/716
sha256 = "c93aaa500b439d71e4a5cf088d0006d2ce2c76f1950960c8843114e5f361dfd3"; src = fetchFromGitHub {
owner = "wireservice";
repo = pname;
rev = version;
sha256 = "077zj8xad8hsa3nqywvf7ircirmx3krxdipl8wr3dynv3l3khcpl";
}; };
propagatedBuildInputs = [ discid six parsedatetime propagatedBuildInputs = [
isodate Babel pytimeparse leather python-slugify ]; six pytimeparse parsedatetime Babel
isodate python-slugify leather
];
doCheck = !isPy3k; checkInputs = [ glibcLocales nose lxml cssselect ]
# (only) on python3 unittest loader (loadTestsFromModule) fails ++ lib.optional (!isPy3k) unittest2;
meta = with stdenv.lib; { checkPhase = ''
LC_ALL="en_US.UTF-8" nosetests tests
'';
meta = with lib; {
description = "A Python data analysis library that is optimized for humans instead of machines"; description = "A Python data analysis library that is optimized for humans instead of machines";
homepage = https://github.com/wireservice/agate; homepage = https://github.com/wireservice/agate;
license = with licenses; [ mit ]; license = with licenses; [ mit ];