1{ lib 2, buildPythonPackage 3, pythonOlder 4, fetchFromGitHub 5, mccabe 6, pycodestyle 7, pyflakes 8, importlib-metadata 9, pythonAtLeast 10, pytestCheckHook 11}: 12 13buildPythonPackage rec { 14 pname = "flake8"; 15 version = "5.0.4"; 16 17 disabled = pythonOlder "3.6"; 18 19 format = "setuptools"; 20 21 src = fetchFromGitHub { 22 owner = "PyCQA"; 23 repo = "flake8"; 24 rev = version; 25 hash = "sha256-Os8HIoM07/iOBMm+0WxdQj32pJJOJ8mkh+yLHpqkLXg="; 26 }; 27 28 propagatedBuildInputs = [ 29 mccabe 30 pycodestyle 31 pyflakes 32 ] ++ lib.optionals (pythonOlder "3.8") [ 33 importlib-metadata 34 ]; 35 36 # Tests fail on Python 3.7 due to importlib using a deprecated interface 37 doCheck = pythonAtLeast "3.7"; 38 39 checkInputs = [ 40 pytestCheckHook 41 ]; 42 43 meta = with lib; { 44 description = "Flake8 is a wrapper around pyflakes, pycodestyle and mccabe."; 45 homepage = "https://github.com/pycqa/flake8"; 46 license = licenses.mit; 47 maintainers = with maintainers; [ dotlambda ]; 48 }; 49}