1{
2 lib,
3 buildPythonPackage,
4 isPyPy,
5 fetchFromGitHub,
6 setuptools,
7 mccabe,
8 pycodestyle,
9 pyflakes,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "flake8";
15 version = "7.3.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "PyCQA";
20 repo = "flake8";
21 tag = version;
22 hash = "sha256-dZFIGyjqkd+MRz9NoOEcMuR9ZshFb/h+zO2OJZsQajc=";
23 };
24
25 build-system = [ setuptools ];
26
27 dependencies = [
28 mccabe
29 pycodestyle
30 pyflakes
31 ];
32
33 nativeCheckInputs = [ pytestCheckHook ];
34
35 disabledTests = lib.optionals isPyPy [
36 # tests fail due to slightly different error position
37 "test_tokenization_error_is_a_syntax_error"
38 "test_tokenization_error_but_not_syntax_error"
39 ];
40
41 meta = {
42 changelog = "https://github.com/PyCQA/flake8/blob/${src.tag}/docs/source/release-notes/${version}.rst";
43 description = "Modular source code checker: pep8, pyflakes and co";
44 homepage = "https://github.com/PyCQA/flake8";
45 license = lib.licenses.mit;
46 maintainers = with lib.maintainers; [ dotlambda ];
47 mainProgram = "flake8";
48 };
49}