1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 01:20:40 +00:00
nixpkgs/pkgs/development/python-modules/pylint/1.9.nix
Kier Davis 443f1a43ef pythonPackages.pylint: add setuptools
Previously it was missing a runtime dependency on setuptools:

    [kier@saelli:~/checkouts/nixpkgs]$ $(nix-build -A python27Packages.pylint --no-out-link)/bin/pylint
    Traceback (most recent call last):
      File "/nix/store/0k8h6n6nxjcs2j5jp54mfppjbx37hrrg-python2.7-pylint-1.9.5/bin/.pylint-wrapped", line 6, in <module>
        from pylint import run_pylint
      File "/nix/store/0k8h6n6nxjcs2j5jp54mfppjbx37hrrg-python2.7-pylint-1.9.5/lib/python2.7/site-packages/pylint/__init__.py", line 11, in <module>
        from .__pkginfo__ import version as __version__
      File "/nix/store/0k8h6n6nxjcs2j5jp54mfppjbx37hrrg-python2.7-pylint-1.9.5/lib/python2.7/site-packages/pylint/__pkginfo__.py", line 25, in <module>
        from pkg_resources import parse_version
    ImportError: No module named pkg_resources

With this change, the same command now correctly prints pylint's help text.

This only applies to Python 2.
2019-10-28 10:52:50 +01:00

52 lines
1.4 KiB
Nix

{ stdenv, lib, buildPythonPackage, fetchPypi, astroid, six, isort,
mccabe, configparser, backports_functools_lru_cache, singledispatch,
pytest, pytestrunner, pyenchant, setuptools }:
buildPythonPackage rec {
pname = "pylint";
version = "1.9.5";
src = fetchPypi {
inherit pname version;
sha256 = "004kfapkqxqy2s85pmddqv0fabxdxywxrlbi549p0v237pr2v94p";
};
checkInputs = [ pytest pytestrunner pyenchant ];
propagatedBuildInputs = [ astroid six isort mccabe configparser backports_functools_lru_cache singledispatch setuptools ];
postPatch = lib.optionalString stdenv.isDarwin ''
# Remove broken darwin test
rm -vf pylint/test/test_functional.py
'';
checkPhase = ''
pytest pylint/test -k "not ${lib.concatStringsSep " and not " (
[ # Broken test
"test_good_comprehension_checks"
# requires setuptools
"test_pkginfo"
# See PyCQA/pylint#2535
"test_libmodule" ] ++
# Disable broken darwin tests
lib.optionals stdenv.isDarwin [
"test_parallel_execution"
"test_py3k_jobs_option"
]
)}"
'';
postInstall = ''
mkdir -p $out/share/emacs/site-lisp
cp "elisp/"*.el $out/share/emacs/site-lisp/
'';
meta = with lib; {
homepage = https://github.com/PyCQA/pylint;
description = "A bug and style checker for Python";
platforms = platforms.all;
license = licenses.gpl1Plus;
maintainers = with maintainers; [ nand0p ];
};
}