nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 62 lines 1.2 kB view raw
1{ lib 2, buildPythonPackage 3, fetchPypi 4, pythonOlder 5, configparser 6, enum34 7, mccabe 8, pycodestyle 9, pyflakes 10, functools32 11, typing 12, importlib-metadata 13, mock 14, pytestCheckHook 15}: 16 17buildPythonPackage rec { 18 pname = "flake8"; 19 version = "4.0.1"; 20 21 src = fetchPypi { 22 inherit pname version; 23 sha256 = "03c7mnk34wfz7a0m5zq0273y94awz69fy5iww8alh4a4v96h6vl0"; 24 }; 25 26 postPatch = '' 27 substituteInPlace setup.cfg \ 28 --replace "mccabe>=0.6.0,<0.7.0" "mccabe>=0.7.0,<0.8.0" 29 ''; 30 31 propagatedBuildInputs = [ 32 pyflakes 33 pycodestyle 34 mccabe 35 ] ++ lib.optionals (pythonOlder "3.2") [ 36 configparser 37 functools32 38 ] ++ lib.optionals (pythonOlder "3.4") [ 39 enum34 40 ] ++ lib.optionals (pythonOlder "3.5") [ 41 typing 42 ] ++ lib.optionals (pythonOlder "3.8") [ 43 importlib-metadata 44 ]; 45 46 # Tests fail on Python 3.7 due to importlib using a deprecated interface 47 doCheck = !(pythonOlder "3.8"); 48 49 checkInputs = [ 50 mock 51 pytestCheckHook 52 ]; 53 54 disabled = pythonOlder "3.6"; 55 56 meta = with lib; { 57 description = "Flake8 is a wrapper around pyflakes, pycodestyle and mccabe."; 58 homepage = "https://github.com/pycqa/flake8"; 59 license = licenses.mit; 60 maintainers = with maintainers; [ ]; 61 }; 62}