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