22 buildPythonPackage rec {
23 pname = "betterproto";
27 disabled = pythonOlder "3.9";
29 src = fetchFromGitHub {
30 owner = "danielgtaylor";
31 repo = "python-betterproto";
32 rev = "refs/tags/v.${version}";
33 hash = "sha256-ZuVq4WERXsRFUPNNTNp/eisWX1MyI7UtwqEI8X93wYI=";
36 build-system = [ poetry-core ];
44 optional-dependencies.compiler = [
57 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
59 pythonImportsCheck = [ "betterproto" ];
61 # The tests require the generation of code before execution. This requires
62 # the protoc-gen-python_betterproto script from the package to be on PATH.
64 (($(ulimit -n) < 1024)) && ulimit -n 1024
65 export PATH=$PATH:$out/bin
66 patchShebangs src/betterproto/plugin/main.py
67 ${python.interpreter} -m tests.generate
71 # https://github.com/danielgtaylor/python-betterproto/issues/530
72 "tests/inputs/oneof/test_oneof.py"
76 "test_pydantic_no_value"
78 "test_binary_compatibility"
82 description = "Code generator & library for Protobuf 3 and async gRPC";
83 mainProgram = "protoc-gen-python_betterproto";
85 This project aims to provide an improved experience when using Protobuf /
86 gRPC in a modern Python environment by making use of modern language
87 features and generating readable, understandable, idiomatic Python code.
89 homepage = "https://github.com/danielgtaylor/python-betterproto";
90 changelog = "https://github.com/danielgtaylor/python-betterproto/blob/v.${version}/CHANGELOG.md";
91 license = licenses.mit;
92 maintainers = with maintainers; [ nikstur ];