-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
132 lines (114 loc) · 3.32 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[tool.poetry]
name = "BrokRPC"
version = "0.2.4"
description = "framework for gRPC like server-client communication over message brokers"
authors = ["zerlok <[email protected]>"]
readme = "README.md"
license = "MIT"
keywords = [
"python",
"protobuf",
"amqp",
"grpc",
"message-queue",
"message-broker",
]
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: System :: Networking",
"Typing :: Typed",
]
[tool.poetry.urls]
Homepage = "https://github.com/zerlok/BrokRPC"
Issues = "https://github.com/zerlok/BrokRPC/issues"
[tool.poetry.dependencies]
python = "^3.12"
yarl = "^1.18.0"
protobuf = {version = "^5.26.1", optional = true}
googleapis-common-protos = {version = "^1.65.0", optional = true}
aiormq = {version = "^6.8.1", optional = true}
aiofiles = {version = "^24.1.0", optional = true}
pydantic = {version = "^2.10.4", optional = true}
[tool.poetry.extras]
cli = ["aiofiles"]
protobuf = ["protobuf", "googleapis-common-protos"]
aiormq = ["aiormq"]
pydantic = ["pydantic"]
[tool.poetry.scripts]
brokrpc = "brokrpc.cli:main"
[tool.poetry.group.dev.dependencies]
types-protobuf = "^5.26.0.20240422"
mypy = "^1.13.0"
pytest = "^8.3.3"
pytest-cov = ">=5,<7"
ruff = "^0.8.0"
pytest-asyncio = "^0.24.0"
pytest-timeout = "^2.3.1"
pytest-mypy-plugins = "^3.1.2"
types-aiofiles = "^24.1.0.20240626"
pyprotostuben = "^0.3.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
target-version = "py312"
include = ["src/**/*.py", "tests/**/*.py"]
exclude = ["**_pb2.py", "**_pb2.pyi", "**_pb2_grpc.py", "**_pb2_grpc.pyi"]
line-length = 120
output-format = "pylint"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN", # because we use mypy
"D", # TODO: add docstrings to public code
"FA", # TODO: consider should we use __annotations__
"TD", # no task tracking
"FIX", # TODO: consider enable it against new code on pull requests
"COM812", # because ruff format suggests to skip it
"ISC001", # because ruff format suggests to skip it
"RET505", # clashes with mypy exhaustiveness check
"S101", # allow asserts for tests checks and mypy help
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"ARG001", # it's ok to use a fixture with a side effect in a test.
"PT004", # fixture may add side effect and doesn't return anything.
]
[tool.mypy]
files = ["src", "tests", "examples/simple.py", "examples/simple_rpc.py"]
strict = true
[[tool.mypy.overrides]]
module = ["google.rpc.*"]
ignore_missing_imports = true
# NOTE: allow return `typing.Any` in test fixtures (e.g. mock objects created with `create_autospec`)
[[tool.mypy.overrides]]
module = ["tests.*"]
warn_return_any = false
[tool.pytest.ini_options]
pythonpath = [
"src",
]
addopts = [
"--timeout=60", # 1 minute for each test
"--cov=src",
"--cov-report=term-missing",
]
testpaths = [
"tests",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_also = [
"if __name__ == .__main__.:",
"if t\\.TYPE_CHECKING:",
"class .*\\(t\\.Protocol\\):",
"@abc\\.abstractmethod",
"t\\.assert_never\\(.*\\)",
]
show_missing = true