summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyannotate/default.nix
blob: 8d81fd78b3df32538b6f9e7d9bc1cb677d2757b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  lib,
  buildPythonPackage,
  fetchPypi,
  mypy-extensions,
  pytestCheckHook,
  pythonAtLeast,
  setuptools,
  six,
}:

buildPythonPackage rec {
  pname = "pyannotate";
  version = "1.2.0";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-BO1YBLqzgVPVmB/JLYPc9qIog0U3aFYfBX53flwFdZk=";
  };

  build-system = [ setuptools ];

  dependencies = [
    six
    mypy-extensions
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [
    "pyannotate_runtime"
    "pyannotate_tools"
  ];

  disabledTestPaths = [
    "pyannotate_runtime/tests/test_collect_types.py"
  ]
  ++ lib.optionals (pythonAtLeast "3.11") [
    # Tests are using lib2to3
    "pyannotate_tools/fixes/tests/test_annotate*.py"
    "pyannotate_tools/annotations/tests/dundermain_test.py"
  ];

  meta = {
    description = "Auto-generate PEP-484 annotations";
    homepage = "https://github.com/dropbox/pyannotate";
    license = lib.licenses.mit;
    maintainers = [ ];
    mainProgram = "pyannotate";
  };
}