Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
148 lines (133 loc) · 3.75 KB
/
Copy pathpyproject.toml
File metadata and controls
148 lines (133 loc) · 3.75 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[build-system]
requires = [
"hatchling",
"hatch-cython",
"setuptools>=40.8.0",
"Cython>=0.29.21,<3.1; python_version < '3.8'",
"Cython>=3.1.0; python_version >= '3.8'",
]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "trpc_sdk/version.py"
# Used by the temporary setuptools build that hatch-cython invokes for
# build_ext. Keep discovery limited to trpc_sdk so sibling directories are ignored.
[tool.setuptools.packages.find]
include = ["trpc_sdk", "trpc_sdk.*"]
[tool.hatch.build.targets.wheel]
packages = ["trpc_sdk"]
# Keep Cython declaration/stub files in the wheel for cimport and typing.
[tool.hatch.build]
include = [
"trpc_sdk/**/*.py",
"trpc_sdk/**/*.pyi",
"trpc_sdk/**/*.pxd",
"trpc_sdk/**/*.pyx",
]
# Apply to wheel and editable installs.
[tool.hatch.build.hooks.cython]
dependencies = ["hatch-cython"]
[tool.hatch.build.hooks.cython.options]
# Project name is trpc-python, but the import package is trpc_sdk.
src = "trpc_sdk"
# Do not compile plain Python modules as extensions.
compile_py = false
directives = { language_level = "3", boundscheck = false, wraparound = false }
[tool.hatch.build.hooks.cython.options.files]
# hatch-cython matches with re.match() from the path start.
exclude = [
# Keep package __init__ as pure Python re-exports; compiling it drops imports.
".*/_cython/__init__\\.(py|pxd)$",
# Header-only inline helpers and their package cimport entry; nothing to build.
".*/utils/_cython/.*\\.pxd$",
".*/utils/__init__\\.pxd$",
]
[project]
name = "trpc-python"
dynamic = ["version"]
description = "A pluggable, high-performance RPC framework written in python"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "Apache-2.0"}
authors = [{ name = "tRPC Group"}]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"loguru",
"protobuf>=3.19.4",
"packaging",
"PyYAML",
"aiohttp>3.6.2",
"aiocron>=1.6",
"netifaces>=0.10.9",
"portalocker>=1.4.0",
"six>=1.15.0",
]
[project.urls]
Homepage = "https://github.com/trpc-group/trpc-python"
Documentation = "https://github.com/trpc-group/trpc-python"
Repository = "https://github.com/trpc-group/trpc-python"
"Issue tracker" = "https://github.com/trpc-group/trpc-python/issues"
[project.optional-dependencies]
snappy = ["python-snappy>=0.5.4"]
dev = [
"pytest",
"pyyaml"
]
fast = [
"uvloop==0.14.0; python_version < '3.7'",
"uvloop>=0.15.0; python_version >= '3.7'",
]
[dependency-groups]
test = [
"pytest-mock",
"pytest-asyncio",
"pytest>=6.1.0",
"pytest-cov",
"xmlrunner; python_version < '3.12'",
"unittest-xml-reporting; python_version >= '3.12'",
]
# uv project configuration. Defaults to the public PyPI index; the project is
# installed as an editable package.
[tool.uv]
package = true
# Keep uv aligned with the package-level Python support. Optional dependencies
# that require a newer interpreter use dependency-level markers above.
# 可选:添加工具配置
[tool.black]
line-length = 120
target-version = ['py38']
exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
| venv
| env
| node_modules
)/
'''
[tool.yapf]
based_on_style = "pep8"
column_limit = 120
indent_width = 4
split_before_logical_operator = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
testpaths = ["tests"]
asyncio_mode = "auto"