Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions pkgs/development/python-modules/betterproto/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,33 @@
, pytestCheckHook
, pytest-asyncio
, pytest-mock
, typing-extensions
, tomlkit
, grpcio-tools
}:

buildPythonPackage rec {
pname = "betterproto";
version = "2.0.0b6";
format = "pyproject";
disabled = pythonOlder "3.7";
pyproject = true;

disabled = pythonOlder "3.9";

src = fetchFromGitHub {
owner = "danielgtaylor";
repo = "python-betterproto";
rev = "v.${version}";
rev = "refs/tags/v.${version}";
hash = "sha256-ZuVq4WERXsRFUPNNTNp/eisWX1MyI7UtwqEI8X93wYI=";
};

nativeBuildInputs = [ poetry-core ];
nativeBuildInputs = [
poetry-core
];

propagatedBuildInputs = [
grpclib
python-dateutil
typing-extensions
];

passthru.optional-dependencies.compiler = [
Expand All @@ -43,16 +48,18 @@ buildPythonPackage rec {
isort
];

pythonImportsCheck = [ "betterproto" ];

nativeCheckInputs = [
grpcio-tools
pydantic
pytestCheckHook
pytest-asyncio
pytest-mock
pytestCheckHook
tomlkit
grpcio-tools
] ++ passthru.optional-dependencies.compiler;
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

pythonImportsCheck = [
"betterproto"
];

# The tests require the generation of code before execution. This requires
# the protoc-gen-python_betterproto script from the package to be on PATH.
Expand All @@ -63,13 +70,14 @@ buildPythonPackage rec {
'';

meta = with lib; {
description = "Clean, modern, Python 3.6+ code generator & library for Protobuf 3 and async gRPC";
description = "Code generator & library for Protobuf 3 and async gRPC";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the upstream description. Not sure why we would want to change that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "marketing part" or "how upstream thinks the project looks like" usually doesn't really add a lot of value to the description. If the library is modern and clean then we would not need to disable tests 😉

Sure, this change is highly opinionated.

longDescription = ''
This project aims to provide an improved experience when using Protobuf /
gRPC in a modern Python environment by making use of modern language
features and generating readable, understandable, idiomatic Python code.
'';
homepage = "https://github.com/danielgtaylor/python-betterproto";
changelog = "https://github.com/danielgtaylor/python-betterproto/blob/v.${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ nikstur ];
};
Expand Down