|
2 | 2 | name = "connect-python" |
3 | 3 | version = "0.5.0" |
4 | 4 | description = "Server and client runtime library for Connect RPC" |
5 | | -readme = "README.md" |
6 | | -requires-python = ">= 3.10" |
7 | | -license-files = ["LICENSE"] |
8 | 5 | maintainers = [ |
9 | | - { name = "Anuraag Agrawal", email = "[email protected]" }, |
10 | | - { name = "Spencer Nelson", email = "[email protected]" }, |
11 | | - { name = "Stefan VanBuren", email = "[email protected]" }, |
12 | | - { name = "Yasushi Itoh", email = "[email protected]" }, |
| 6 | + { name = "Anuraag Agrawal", email = "[email protected]" }, |
| 7 | + { name = "Spencer Nelson", email = "[email protected]" }, |
| 8 | + { name = "Stefan VanBuren", email = "[email protected]" }, |
| 9 | + { name = "Yasushi Itoh", email = "[email protected]" }, |
13 | 10 | ] |
14 | | -keywords = ["connect", "grpc", "http", "protobuf", "rpc"] |
| 11 | +requires-python = ">= 3.10" |
| 12 | +dependencies = ["httpx>=0.28.1", "protobuf>=5.28"] |
| 13 | +readme = "README.md" |
| 14 | +license-files = ["LICENSE"] |
| 15 | +keywords = ["rpc", "grpc", "connect", "protobuf", "http"] |
15 | 16 | classifiers = [ |
16 | | - "Development Status :: 3 - Alpha", |
17 | | - "Intended Audience :: Developers", |
18 | | - "License :: OSI Approved :: Apache Software License", |
19 | | - "Operating System :: OS Independent", |
20 | | - "Programming Language :: Python :: 3", |
21 | | - "Programming Language :: Python :: 3.10", |
22 | | - "Programming Language :: Python :: 3.11", |
23 | | - "Programming Language :: Python :: 3.12", |
24 | | - "Programming Language :: Python :: 3.13", |
25 | | - "Topic :: Internet :: WWW/HTTP", |
26 | | - "Topic :: Software Development :: Libraries :: Python Modules", |
27 | | - "Typing :: Typed", |
| 17 | + "Development Status :: 3 - Alpha", |
| 18 | + "Intended Audience :: Developers", |
| 19 | + "License :: OSI Approved :: Apache Software License", |
| 20 | + "Operating System :: OS Independent", |
| 21 | + "Programming Language :: Python :: 3", |
| 22 | + "Programming Language :: Python :: 3.10", |
| 23 | + "Programming Language :: Python :: 3.11", |
| 24 | + "Programming Language :: Python :: 3.12", |
| 25 | + "Programming Language :: Python :: 3.13", |
| 26 | + "Topic :: Internet :: WWW/HTTP", |
| 27 | + "Topic :: Software Development :: Libraries :: Python Modules", |
| 28 | + "Typing :: Typed", |
28 | 29 | ] |
29 | | -dependencies = ["httpx>=0.28.1", "protobuf>=5.28"] |
30 | 30 |
|
31 | 31 | [project.urls] |
32 | 32 | Homepage = "https://github.com/connectrpc/connect-python" |
33 | | -Issues = "https://github.com/connectrpc/connect-python/issues" |
34 | 33 | Repository = "https://github.com/connectrpc/connect-python" |
| 34 | +Issues = "https://github.com/connectrpc/connect-python/issues" |
35 | 35 |
|
36 | 36 | [dependency-groups] |
37 | 37 | dev = [ |
38 | | - "asgiref==3.9.1", |
39 | | - "brotli==1.1.0", |
40 | | - "connect-python-example", |
41 | | - "httpx[http2]==0.28.1", |
42 | | - "hypercorn==0.17.3", |
43 | | - "just-bin==1.42.4; sys_platform != 'win32'", |
44 | | - "mkdocs==1.6.1", |
45 | | - "mkdocs-material==9.6.20", |
46 | | - "mkdocstrings[python]==0.30.1", |
47 | | - "pyright[nodejs]==1.1.405", |
48 | | - "pytest==8.4.2", |
49 | | - "pytest-asyncio==1.1.0", |
50 | | - "pytest-cov==7.0.0", |
51 | | - "ruff~=0.13.2", |
52 | | - "typing_extensions==4.15.0", |
53 | | - "zstandard==0.25.0", |
| 38 | + "asgiref==3.9.1", |
| 39 | + "brotli==1.1.0", |
| 40 | + "connect-python-example", |
| 41 | + "httpx[http2]==0.28.1", |
| 42 | + "hypercorn==0.17.3", |
| 43 | + "just-bin==1.42.4; sys_platform != 'win32'", |
| 44 | + "mkdocs==1.6.1", |
| 45 | + "mkdocs-material==9.6.20", |
| 46 | + "mkdocstrings[python]==0.30.1", |
| 47 | + "pyright[nodejs]==1.1.405", |
| 48 | + "pytest==8.4.2", |
| 49 | + "pytest-asyncio==1.1.0", |
| 50 | + "pytest-cov==7.0.0", |
| 51 | + "ruff~=0.13.2", |
| 52 | + "typing_extensions==4.15.0", |
| 53 | + "zstandard==0.25.0", |
54 | 54 | ] |
55 | 55 |
|
56 | 56 | [build-system] |
57 | 57 | requires = ["uv_build>=0.8.13,<0.9.0"] |
58 | 58 | build-backend = "uv_build" |
59 | 59 |
|
60 | | -[tool.pyright] |
61 | | -exclude = [ |
62 | | - # Defaults. |
63 | | - "**/node_modules", |
64 | | - "**/__pycache__", |
65 | | - "**/.*", |
66 | | - # GRPC python files don't typecheck on their own. |
67 | | - # See https://github.com/grpc/grpc/issues/39555 |
68 | | - "**/*_pb2_grpc.py", |
69 | | - # TODO: Work out the import issues to allow it to work. |
70 | | - "conformance/**", |
71 | | -] |
| 60 | +[tool.uv] |
| 61 | +resolution = "lowest-direct" |
| 62 | + |
| 63 | +[tool.uv.build-backend] |
| 64 | +module-name = "connectrpc" |
72 | 65 |
|
73 | 66 | [tool.pytest.ini_options] |
74 | 67 | testpaths = ["test"] |
75 | 68 |
|
76 | | -[tool.ruff] |
77 | | -# Don't run ruff on generated code from external plugins. |
78 | | -extend-exclude = ["*_pb2.py", "*_pb2.pyi"] |
79 | | - |
80 | 69 | [tool.ruff.format] |
81 | 70 | skip-magic-trailing-comma = true |
82 | 71 | docstring-code-format = true |
83 | 72 |
|
84 | 73 | [tool.ruff.lint] |
85 | 74 | extend-select = [ |
86 | | - # Same order as listed on https://docs.astral.sh/ruff/rules/ |
87 | | - "YTT", |
88 | | - "ANN", |
89 | | - "ASYNC", |
90 | | - "S", |
91 | | - "FBT", |
92 | | - "B", |
93 | | - "A", |
94 | | - "COM818", # Other comma rules are handled by formatting |
95 | | - "C4", |
96 | | - "DTZ", |
97 | | - "T10", |
98 | | - "EM", |
99 | | - "EXE", |
100 | | - "FA", |
101 | | - "ISC", |
102 | | - "ICN", |
103 | | - "LOG", |
104 | | - "G", |
105 | | - "INP", |
106 | | - "PIE", |
107 | | - "T20", |
108 | | - "PYI", |
109 | | - "PT", |
110 | | - "Q004", # Other quote rules are handled by formatting |
111 | | - "RSE", |
112 | | - "RET", |
113 | | - # This rule is a bit strict since accessing private members within this package can be |
114 | | - # useful to reduce public API exposure. But it is important to not access private members |
115 | | - # of dependencies like httpx so we enable it and ignore the locations where we need to. |
116 | | - "SLF", |
117 | | - "SIM", |
118 | | - "SLOT", |
119 | | - "TID", |
120 | | - # TODO: Update TODOs then enable |
121 | | - # "TD", |
122 | | - "TC", |
123 | | - "ARG", |
124 | | - "PTH", |
125 | | - "FLY", |
126 | | - "I", |
127 | | - "N", |
128 | | - "PERF", |
129 | | - "E", |
130 | | - "W", |
131 | | - # TODO: Flesh out docs and enable |
132 | | - # "DOC" |
133 | | - # "D", |
134 | | - "F", |
135 | | - "PGH", |
136 | | - "PLC", |
137 | | - "PLE", |
138 | | - "PLW", |
139 | | - "UP", |
140 | | - "FURB", |
141 | | - "RUF", |
142 | | - # TODO: See if it makes sense to enable after a pass at reducing code duplication |
143 | | - # "TRY", |
| 75 | + # Same order as listed on https://docs.astral.sh/ruff/rules/ |
| 76 | + "YTT", |
| 77 | + "ANN", |
| 78 | + "ASYNC", |
| 79 | + "S", |
| 80 | + "FBT", |
| 81 | + "B", |
| 82 | + "A", |
| 83 | + "COM818", # Other comma rules are handled by formatting |
| 84 | + "C4", |
| 85 | + "DTZ", |
| 86 | + "T10", |
| 87 | + "EM", |
| 88 | + "EXE", |
| 89 | + "FA", |
| 90 | + "ISC", |
| 91 | + "ICN", |
| 92 | + "LOG", |
| 93 | + "G", |
| 94 | + "INP", |
| 95 | + "PIE", |
| 96 | + "T20", |
| 97 | + "PYI", |
| 98 | + "PT", |
| 99 | + "Q004", # Other quote rules are handled by formatting |
| 100 | + "RSE", |
| 101 | + "RET", |
| 102 | + # This rule is a bit strict since accessing private members within this package can be |
| 103 | + # useful to reduce public API exposure. But it is important to not access private members |
| 104 | + # of dependencies like httpx so we enable it and ignore the locations where we need to. |
| 105 | + "SLF", |
| 106 | + "SIM", |
| 107 | + "SLOT", |
| 108 | + "TID", |
| 109 | + # TODO: Update TODOs then enable |
| 110 | + # "TD", |
| 111 | + "TC", |
| 112 | + "ARG", |
| 113 | + "PTH", |
| 114 | + "FLY", |
| 115 | + "I", |
| 116 | + "N", |
| 117 | + "PERF", |
| 118 | + "E", |
| 119 | + "W", |
| 120 | + # TODO: Flesh out docs and enable |
| 121 | + # "DOC" |
| 122 | + # "D", |
| 123 | + "F", |
| 124 | + "PGH", |
| 125 | + "PLC", |
| 126 | + "PLE", |
| 127 | + "PLW", |
| 128 | + "UP", |
| 129 | + "FURB", |
| 130 | + "RUF", |
| 131 | + # TODO: See if it makes sense to enable after a pass at reducing code duplication |
| 132 | + # "TRY", |
144 | 133 | ] |
| 134 | + |
145 | 135 | # Document reasons for ignoring specific linting errors |
146 | 136 | extend-ignore = [ |
147 | | - # Not applicable |
148 | | - "AIR", |
149 | | - # Dangerous false positives https://github.com/astral-sh/ruff/issues/4845 |
150 | | - "ERA", |
151 | | - # Not Applicable |
152 | | - "FAST", |
153 | | - # Important to call user callbacks safely |
154 | | - "BLE", |
155 | | - # stdlib includes a module named code. This is less of an issue since users need to import a module so allow it |
156 | | - "A005", |
157 | | - # TODO: Consider using copyright headers |
158 | | - "CPY", |
159 | | - # Not Applicable |
160 | | - "DJ", |
161 | | - # It's fine to have TODOs |
162 | | - "FIX", |
163 | | - # Not Applicable |
164 | | - "INT", |
165 | | - # Even prevents pytest.raises around an iteration which is too strict |
166 | | - "PT012", |
167 | | - # Triggers for protocol implementations that don't need the arg too |
168 | | - "ARG002", |
169 | | - # Complexity checks usually reduce readability |
170 | | - "C90", |
171 | | - # Not Applicable |
172 | | - "NPY", |
173 | | - # Not Applicable |
174 | | - "PD", |
175 | | - # We use the Exception suffix instead |
176 | | - "N818", |
177 | | - # Handled by formatting |
178 | | - "E111", |
179 | | - "E114", |
180 | | - "E117", |
181 | | - "E501", |
182 | | - "W191", |
183 | | - # Low signal-to-noise ratio |
184 | | - "PLR", |
| 137 | + # Not applicable |
| 138 | + "AIR", |
| 139 | + # Dangerous false positives https://github.com/astral-sh/ruff/issues/4845 |
| 140 | + "ERA", |
| 141 | + # Not Applicable |
| 142 | + "FAST", |
| 143 | + # Important to call user callbacks safely |
| 144 | + "BLE", |
| 145 | + # stdlib includes a module named code. This is less of an issue since users need to import a module so allow it |
| 146 | + "A005", |
| 147 | + # TODO: Consider using copyright headers |
| 148 | + "CPY", |
| 149 | + # Not Applicable |
| 150 | + "DJ", |
| 151 | + # It's fine to have TODOs |
| 152 | + "FIX", |
| 153 | + # Not Applicable |
| 154 | + "INT", |
| 155 | + # Even prevents pytest.raises around an iteration which is too strict |
| 156 | + "PT012", |
| 157 | + # Triggers for protocol implementations that don't need the arg too |
| 158 | + "ARG002", |
| 159 | + # Complexity checks usually reduce readability |
| 160 | + "C90", |
| 161 | + # Not Applicable |
| 162 | + "NPY", |
| 163 | + # Not Applicable |
| 164 | + "PD", |
| 165 | + # We use the Exception suffix instead |
| 166 | + "N818", |
| 167 | + # Handled by formatting |
| 168 | + "E111", |
| 169 | + "E114", |
| 170 | + "E117", |
| 171 | + "E501", |
| 172 | + "W191", |
| 173 | + # Low signal-to-noise ratio |
| 174 | + "PLR", |
185 | 175 | ] |
186 | 176 |
|
187 | 177 | [tool.ruff.lint.per-file-ignores] |
188 | 178 | "conformance/test/**" = ["ANN", "INP", "SLF", "SIM115", "D"] |
189 | 179 | "example/**" = [ |
190 | | - "ANN", |
191 | | - "S", # Keep examples simpler, e.g. allow normal random |
192 | | - "T20", |
193 | | - "D", |
| 180 | + "ANN", |
| 181 | + "S", # Keep examples simpler, e.g. allow normal random |
| 182 | + "T20", |
| 183 | + "D", |
194 | 184 | ] |
195 | 185 | "**/test_*.py" = [ |
196 | | - "ANN", |
197 | | - "S101", |
198 | | - "S603", |
199 | | - "S607", |
200 | | - "FBT", |
201 | | - "EM", |
202 | | - "INP", |
203 | | - "SLF", |
204 | | - "PERF", |
205 | | - "D", |
| 186 | + "ANN", |
| 187 | + "S101", |
| 188 | + "S603", |
| 189 | + "S607", |
| 190 | + "FBT", |
| 191 | + "EM", |
| 192 | + "INP", |
| 193 | + "SLF", |
| 194 | + "PERF", |
| 195 | + "D", |
206 | 196 | ] |
207 | 197 |
|
208 | 198 | [tool.ruff.lint.isort] |
209 | 199 | split-on-trailing-comma = false |
210 | 200 |
|
211 | | -[tool.uv] |
212 | | -resolution = "lowest-direct" |
| 201 | +[tool.ruff] |
| 202 | +# Don't run ruff on generated code from external plugins. |
| 203 | +extend-exclude = ["*_pb2.py", "*_pb2.pyi"] |
213 | 204 |
|
214 | | -[tool.uv.build-backend] |
215 | | -module-name = "connectrpc" |
| 205 | +[tool.pyright] |
| 206 | +exclude = [ |
| 207 | + # Defaults. |
| 208 | + "**/node_modules", |
| 209 | + "**/__pycache__", |
| 210 | + "**/.*", |
| 211 | + |
| 212 | + # GRPC python files don't typecheck on their own. |
| 213 | + # See https://github.com/grpc/grpc/issues/39555 |
| 214 | + "**/*_pb2_grpc.py", |
| 215 | + |
| 216 | + # TODO: Work out the import issues to allow it to work. |
| 217 | + "conformance/**", |
| 218 | +] |
216 | 219 |
|
217 | 220 | [tool.uv.workspace] |
218 | 221 | members = ["example", "noextras"] |
|
0 commit comments