3
0
Fork 0
forked from mirrors/nixpkgs

python.pkgs.astroid: fix build

This commit is contained in:
Robert Schütz 2018-07-24 01:08:05 +02:00 committed by Frederik Rietdijk
parent 94d87e4c1e
commit 673d0bed95

View file

@ -1,32 +1,25 @@
{ lib, fetchPypi, buildPythonPackage, python, logilab_common, six
, lazy-object-proxy, wrapt, singledispatch, enum34, pythonOlder
, backports_functools_lru_cache
{ lib, fetchPypi, buildPythonPackage, pythonOlder, isPyPy
, lazy-object-proxy, six, wrapt, typing, typed-ast
, pytestrunner, pytest
}:
buildPythonPackage rec {
pname = "astroid";
version = "2.0.1";
disabled = pythonOlder "3.4";
src = fetchPypi {
inherit pname version;
sha256 = "218e36cf8d98a42f16214e8670819ce307fa707d1dcf7f9af84c7aede1febc7f";
};
propagatedBuildInputs = [ logilab_common six lazy-object-proxy wrapt ]
++ lib.optionals (pythonOlder "3.4") [ enum34 singledispatch]
++ lib.optionals (pythonOlder "3.3") [ backports_functools_lru_cache ];
# From astroid/__pkginfo__.py
propagatedBuildInputs = [ lazy-object-proxy six wrapt ]
++ lib.optional (pythonOlder "3.5") typing
++ lib.optional (pythonOlder "3.7" && !isPyPy) typed-ast;
postPatch = ''
cd astroid/tests
for i in $(ls unittest*); do mv -v $i test_$i; done
cd ../..
rm -vf astroid/tests/test_unittest_inference.py
rm -vf astroid/tests/test_unittest_manager.py
'';
checkPhase = ''
${python.interpreter} -m unittest discover
'';
checkInputs = [ pytestrunner pytest ];
meta = with lib; {
description = "A abstract syntax tree for Python with inference support";