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 pythonRelaxDeps = [ "protobuf" ]; 28 29 build-system = [ setuptools ]; 30 31 dependencies = [ 32 grpcio-tools 33 protobuf 34 types-protobuf 35 ]; 36 37 doCheck = false; # ModuleNotFoundError: No module named 'testproto' 38 39 nativeCheckInputs = [ pytestCheckHook ]; 40 41 pythonImportsCheck = [ "mypy_protobuf" ]; 42 43 passthru.tests.version = testers.testVersion { 44 package = mypy-protobuf; 45 command = "${lib.getExe mypy-protobuf} --version"; 46 }; 47 48 meta = { 49 changelog = "https://github.com/nipunn1313/mypy-protobuf/blob/v${version}/CHANGELOG.md"; 50 description = "Generate mypy stub files from protobuf specs"; 51 homepage = "https://github.com/nipunn1313/mypy-protobuf"; 52 license = lib.licenses.asl20; 53 mainProgram = "protoc-gen-mypy"; 54 maintainers = with lib.maintainers; [ lnl7 ]; 55 }; 56}