1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 poetry-core,
7 charset-normalizer,
8 untokenize,
9 mock,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "docformatter";
15 version = "1.7.7";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "PyCQA";
20 repo = "docformatter";
21 tag = "v${version}";
22 hash = "sha256-eLjaHso1p/nD9K0E+HkeBbnCnvjZ1sdpfww9tzBh0TI=";
23 };
24
25 patches = [ ./test-path.patch ];
26
27 postPatch = ''
28 substituteInPlace tests/conftest.py \
29 --subst-var-by docformatter $out/bin/docformatter
30 '';
31
32 build-system = [ poetry-core ];
33
34 dependencies = [
35 charset-normalizer
36 untokenize
37 ];
38
39 nativeCheckInputs = [
40 mock
41 pytestCheckHook
42 ];
43
44 disabledTests = [
45 # AssertionError: assert 'utf_16' == 'latin-1'
46 # fixed by https://github.com/PyCQA/docformatter/pull/323
47 "test_detect_encoding_with_undetectable_encoding"
48 ];
49
50 pythonImportsCheck = [ "docformatter" ];
51
52 meta = {
53 changelog = "https://github.com/PyCQA/docformatter/blob/${src.tag}/CHANGELOG.md";
54 description = "Formats docstrings to follow PEP 257";
55 mainProgram = "docformatter";
56 homepage = "https://github.com/myint/docformatter";
57 license = lib.licenses.mit;
58 maintainers = with lib.maintainers; [ dotlambda ];
59 };
60}