Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 grpcio-tools,
5 lib,
6 mypy-protobuf,
7 protobuf,
8 pytestCheckHook,
9 setuptools,
10 testers,
11 types-protobuf,
12}:
13
14buildPythonPackage (finalAttrs: {
15 pname = "mypy-protobuf";
16 version = "5.0.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "nipunn1313";
21 repo = "mypy-protobuf";
22 rev = "47fa102ae5d2bd2a1fdde2adf94cf006a3e939a4"; # not tagged, but on pypi
23 hash = "sha256-VYDTJmiezHAVC3QV+HM7C5y5WaFvoInzupWhnB/iNgA=";
24 };
25
26 pythonRelaxDeps = [ "protobuf" ];
27
28 build-system = [ setuptools ];
29
30 dependencies = [
31 grpcio-tools
32 protobuf
33 types-protobuf
34 ];
35
36 doCheck = false; # ModuleNotFoundError: No module named 'testproto'
37
38 nativeCheckInputs = [ pytestCheckHook ];
39
40 pythonImportsCheck = [ "mypy_protobuf" ];
41
42 passthru.tests.version = testers.testVersion {
43 package = mypy-protobuf;
44 command = "${lib.getExe mypy-protobuf} --version";
45 };
46
47 meta = {
48 changelog = "https://github.com/nipunn1313/mypy-protobuf/blob/v${finalAttrs.version}/CHANGELOG.md";
49 description = "Generate mypy stub files from protobuf specs";
50 homepage = "https://github.com/nipunn1313/mypy-protobuf";
51 license = lib.licenses.asl20;
52 mainProgram = "protoc-gen-mypy";
53 maintainers = with lib.maintainers; [ lnl7 ];
54 };
55})