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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{
lib,
buildPythonPackage,
django-stubs,
fetchFromGitHub,
mypy,
py,
coreapi,
pytest-mypy-plugins,
pytestCheckHook,
requests,
types-pyyaml,
setuptools,
types-markdown,
types-requests,
typing-extensions,
}:
buildPythonPackage rec {
pname = "djangorestframework-stubs";
version = "3.16.2";
pyproject = true;
src = fetchFromGitHub {
owner = "typeddjango";
repo = "djangorestframework-stubs";
tag = version;
hash = "sha256-A6IyRJwuc0eqRtkCHtWN5C5yCMdgxfygqmpHV+/MJhE=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "<79.0.0" ""
'';
build-system = [ setuptools ];
dependencies = [
django-stubs
requests
types-pyyaml
types-requests
typing-extensions
];
optional-dependencies = {
compatible-mypy = [ mypy ] ++ django-stubs.optional-dependencies.compatible-mypy;
coreapi = [ coreapi ];
markdown = [ types-markdown ];
};
nativeCheckInputs = [
py
pytest-mypy-plugins
pytestCheckHook
]
++ lib.concatAttrValues optional-dependencies;
# Upstream recommends mypy > 1.7 which we don't have yet, thus all tests are failing with 3.14.5 and below
doCheck = false;
pythonImportsCheck = [ "rest_framework-stubs" ];
meta = {
description = "PEP-484 stubs for Django REST Framework";
homepage = "https://github.com/typeddjango/djangorestframework-stubs";
changelog = "https://github.com/typeddjango/djangorestframework-stubs/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = [ ];
};
}
|