1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 glibcLocales,
6 pycodestyle,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10 tomli,
11}:
12
13buildPythonPackage rec {
14 pname = "autopep8";
15 version = "2.3.2";
16 pyproject = true;
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "hhatto";
22 repo = "autopep8";
23 tag = "v${version}";
24 hash = "sha256-9OJ5XbzpHMHsFjf5oVyHjn5zqmAxRuSItWP4sQx8jD4=";
25 };
26
27 build-system = [ setuptools ];
28
29 propagatedBuildInputs = [ pycodestyle ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
30
31 nativeCheckInputs = [
32 glibcLocales
33 pytestCheckHook
34 ];
35
36 env.LC_ALL = "en_US.UTF-8";
37
38 meta = with lib; {
39 changelog = "https://github.com/hhatto/autopep8/releases/tag/v${version}";
40 description = "Tool that automatically formats Python code to conform to the PEP 8 style guide";
41 homepage = "https://github.com/hhatto/autopep8";
42 license = licenses.mit;
43 mainProgram = "autopep8";
44 maintainers = with maintainers; [ bjornfor ];
45 };
46}