1{
2 buildPythonPackage,
3 fetchPypi,
4 grpcio-tools,
5 lib,
6 mypy-protobuf,
7 protobuf,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11 testers,
12 types-protobuf,
13}:
14
15buildPythonPackage rec {
16 pname = "mypy-protobuf";
17 version = "3.6.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-AvJC6zQJ9miJ8rGjqlg1bsTZCc3Q+TEVYi6ecDZuyjw=";
25 };
26
27
28 pythonRelaxDeps = [ "protobuf" ];
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 grpcio-tools
34 protobuf
35 types-protobuf
36 ];
37
38 doCheck = false; # ModuleNotFoundError: No module named 'testproto'
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 pythonImportsCheck = [ "mypy_protobuf" ];
43
44 passthru.tests.version = testers.testVersion {
45 package = mypy-protobuf;
46 command = "${lib.getExe mypy-protobuf} --version";
47 };
48
49 meta = {
50 changelog = "https://github.com/nipunn1313/mypy-protobuf/blob/v${version}/CHANGELOG.md";
51 description = "Generate mypy stub files from protobuf specs";
52 homepage = "https://github.com/nipunn1313/mypy-protobuf";
53 license = lib.licenses.asl20;
54 mainProgram = "protoc-gen-mypy";
55 maintainers = with lib.maintainers; [ lnl7 ];
56 };
57}