Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 poetry-dynamic-versioning,
7 typing-extensions,
8 pytestCheckHook,
9 pytest-benchmark,
10 pytest-cov-stub,
11 pydantic,
12}:
13
14buildPythonPackage rec {
15 pname = "pure-protobuf";
16 version = "3.1.5";
17
18 pyproject = true;
19 # < 3.10 requires get-annotations which isn't packaged yet
20
21 src = fetchFromGitHub {
22 owner = "eigenein";
23 repo = "protobuf";
24 tag = version;
25 hash = "sha256-Gr5fKpagSUzH34IKHb+pBta4q71AqYa/KG9XW2AxZqk=";
26 };
27
28 build-system = [
29 poetry-core
30 poetry-dynamic-versioning
31 typing-extensions
32 ];
33
34 dependencies = [ typing-extensions ];
35
36 nativeCheckInputs = [
37 pydantic
38 pytestCheckHook
39 pytest-benchmark
40 pytest-cov-stub
41 ];
42
43 pytestFlags = [ "--benchmark-disable" ];
44
45 pythonImportsCheck = [ "pure_protobuf" ];
46
47 meta = {
48 description = "Python implementation of Protocol Buffers with dataclass-based schemas";
49 homepage = "https://github.com/eigenein/protobuf";
50 changelog = "https://github.com/eigenein/protobuf/releases/tag/${src.tag}";
51 license = lib.licenses.mit;
52 maintainers = with lib.maintainers; [ chuangzhu ];
53 };
54}