-
Notifications
You must be signed in to change notification settings - Fork 769
Expand file tree
/
Copy pathpyproject.toml
More file actions
357 lines (312 loc) · 10.8 KB
/
pyproject.toml
File metadata and controls
357 lines (312 loc) · 10.8 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
[build-system]
requires = ["hatchling", "cffi>=2.0.0", "setuptools>=70.0.0"]
build-backend = "hatchling.build"
[project]
name = "autobahn"
version = "25.12.2"
description = "WebSocket client & server library, WAMP real-time framework"
readme = "README.md"
requires-python = ">=3.11"
license = "MIT"
# Twine 6.2 validator (via pkginfo) still flags license-files as "unrecognized or malformed",
# because it only understands the old-style License: field (Core Metadata 2.3).
# Rely on modern setuptools (80.9.0+) which automatically discovers LICENSE* files at the root.
# license-files = ["LICENSE"]
authors = [
{name = "typedef int GmbH", email = "contact@typedefint.eu"}
]
keywords = ["autobahn", "crossbar", "websocket", "realtime", "rfc6455", "wamp", "rpc", "pubsub", "twisted", "asyncio"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: No Input/Output (Daemon)",
"Framework :: Twisted",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Communications",
"Topic :: System :: Distributed Computing",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Object Brokering",
]
dependencies = [
"txaio>=25.12.2",
"cryptography>=3.4.6",
"cffi>=2.0.0", # Required for NVX native extensions; works on both CPython and PyPy
"hyperlink>=21.0.0",
"importlib-resources>=5.0.0; python_version < '3.10'",
# WAMP serializers - batteries included for optimal WAMP protocol support
# CPython uses native binary wheels where available; PyPy uses pure Python (faster with JIT)
"msgpack>=1.0.2; platform_python_implementation == 'CPython'",
"u-msgpack-python>=2.1; platform_python_implementation != 'CPython'",
"ujson>=4.0.2", # Binary wheels for both CPython and PyPy
"cbor2>=5.2.0", # Binary wheels + pure Python fallback
"py-ubjson>=0.16.1", # Pure Python implementation (set PYUBJSON_NO_EXTENSION=1 to skip C extension build)
# flatbuffers is vendored - no external dependency needed
]
[project.optional-dependencies]
# Twisted dependencies
twisted = [
"zope.interface>=5.2.0",
"twisted>=22.10.0",
"attrs>=20.3.0",
]
# C-based WebSocket acceleration (only use on CPython, not PyPy!)
accelerate = [
# "wsaccel>=0.6.3; platform_python_implementation == 'CPython' and sys_platform != 'win32'"
]
# non-standard WebSocket compression support
# Note: zlib/deflate is always available (Python stdlib)
compress = [
"brotli>=1.0.0; platform_python_implementation == 'CPython'", # CPyExt for CPython
"brotlicffi>=1.0.0; platform_python_implementation != 'CPython'", # CFFI for PyPy
# python-snappy is optional - only available if installed separately
# Users who need snappy: pip install python-snappy
]
# Backwards compatibility - serialization now included by default in base install
# All WAMP serializers (JSON, MessagePack, CBOR, UBJSON, Flatbuffers) are always available
serialization = []
# TLS transport encryption, WAMP-cryptosign end-to-end encryption and authentication
encryption = [
"pyopenssl>=20.0.1",
"service-identity>=18.1.0",
"pynacl>=1.4.0",
"pytrie>=0.4.0",
"qrcode>=7.3.1",
"base58>=2.1.1",
"ecdsa>=0.19.1",
]
# Support for WAMP-SCRAM authentication
scram = [
"argon2-cffi>=20.1.0",
"passlib>=1.7.4",
]
# Support native vector (SIMD) acceleration included with Autobahn
# Note: cffi is now in base dependencies, this extra is kept for backwards compatibility
nvx = []
# WAMP serialization benchmarking (Python 3.11+ only, requires binary wheels)
# vmprof has wheels for CPython 3.11 and PyPy3 on Linux/macOS/Windows
# Note: Flamegraph generation also requires Perl (for flamegraph.pl script)
benchmark = [
"vmprof>=0.4.15; python_version >= '3.11'",
"vmprof-flamegraph>=0.0.1; python_version >= '3.11'",
"jinja2>=3.0.0",
"humanize>=4.0.0",
]
# Minimal build dependencies (for building wheels in CI/CD)
# Excludes tools like twine (which depends on nh3, a Rust package that
# segfaults under QEMU ARM64 emulation) as twine is only needed for uploading
build-tools = [
"build>=1.0.0",
"wheel>=0.36.2",
"auditwheel>=5.0.0; sys_platform == 'linux'",
]
# Development dependencies
dev = [
"auditwheel>=5.0.0; sys_platform == 'linux'",
"backports.tempfile>=1.0",
"build>=1.0.0",
"bumpversion>=0.5.3",
"codecov>=2.0.15",
"humanize>=4.0.0",
# Note: ty (Astral type checker) is installed via `uv tool install ty`
# It's a standalone Rust binary, not a Python package dependency
"passlib",
"pep8-naming>=0.3.3",
"pyflakes>=1.0.0",
"pyinstaller>=4.2",
"pylint>=1.9.2",
"pytest-aiohttp",
"pytest-asyncio>=0.14.0",
"pytest-runner>=2.11.1",
"pytest>=3.4.2",
"pyyaml>=4.2b4",
"qualname>=0.1.0",
"ruff>=0.12.1",
"twisted>=22.10.0",
"txaio>=25.12.2",
"watchdog>=0.8.3",
"wheel>=0.36.2",
"yapf==0.29.0",
# Documentation tools (aligned with docs/conf.py extensions)
"sphinx>=8.2.3",
"myst-parser>=2.0",
"furo>=2024.7.0",
"sphinx-autoapi>=2.1.0",
"sphinx-copybutton>=0.5",
"sphinx-design>=0.5",
"sphinxcontrib-images>=0.9",
"sphinxcontrib-spelling>=8.0",
"pyenchant>=3.2",
"scour>=0.38",
"sphinxext-opengraph>=0.9",
"linkify-it-py>=2.0.0",
"twine>=3.3.0",
]
# Documentation tools (used by RTD via .readthedocs.yaml)
docs = [
# Core Sphinx + MyST
"sphinx>=8.2.3",
"myst-parser>=2.0",
# Theme
"furo>=2024.7.0",
# API docs (no-import parsing)
"sphinx-autoapi>=2.1.0",
# UX Enhancements
"sphinx-copybutton>=0.5",
"sphinx-design>=0.5",
"sphinxcontrib-images>=0.9",
# Spell checking
"sphinxcontrib-spelling>=8.0",
"pyenchant>=3.2",
# Static asset optimization
"scour>=0.38",
# Social previews
"sphinxext-opengraph>=0.9",
# MyST auto-linking
"linkify-it-py>=2.0.0",
]
# Everything combined
all = [
"autobahn[twisted,accelerate,compress,serialization,encryption,scram,nvx]"
]
# Backwards compatibility
asyncio = []
[project.urls]
"Homepage" = "https://autobahn.readthedocs.io/"
"Source" = "https://github.com/crossbario/autobahn-python"
[project.scripts]
wamp = "autobahn.__main__:_main"
flatc = "autobahn._flatc:main"
# Hatchling build configuration
[tool.hatch.build.targets.wheel]
packages = ["src/autobahn", "src/twisted"]
# Include non-Python files in the wheel
[tool.hatch.build.targets.wheel.force-include]
# Include py.typed marker
"src/autobahn/py.typed" = "autobahn/py.typed"
[tool.hatch.build.targets.sdist]
# By default, hatchling includes all git-tracked files
# Exclude build artifacts and large submodules from sdist
exclude = [
"/.github",
"/docs/_build",
"/.venvs",
"/.uv-cache",
"/.coverage",
"/.pytest_cache",
"/.mypy_cache",
"/.ruff_cache",
# Exclude large git submodules - flatbuffers runtime is vendored at build time
"/deps/flatbuffers",
]
# Custom build hook for CFFI extension modules (NVX)
[tool.hatch.build.hooks.custom]
# Uses hatch_build.py by default
[tool.rstfmt]
# rstfmt configuration: ReST (Sphinx) doc files
width = 65
[tool.ruff]
# Same as Black.
line-length = 88
indent-width = 4
target-version = "py311" # Adjust to your Python version
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
# --- Files and Directories to Ignore ---
# Exclude auto-generated files and compatibility layers.
exclude = [
".tox",
".git",
"__pycache__",
"src/autobahn/wamp/message_fbs.py",
"src/autobahn/wamp/gen/*",
"src/autobahn/flatbuffers/*", # Vendored Flatbuffers Python runtime (copied from deps/flatbuffers at build time)
"deps/*", # Git submodules (includes deps/flatbuffers)
]
# --- Violations to Ignore ---
# This is our "technical debt" list.
# We should aim to remove codes from this list over time.
ignore = [
# E275: missing whitespace after keyword
"E275",
# F401 [*] X imported but unused
"F401",
# E402: module level import not at top of file
"E402",
# F403 X used; unable to detect undefined names
"F403",
# F405 X may be undefined, or defined from star imports
"F405",
# E501: line too long (handled by max-line-length)
# E501 is often ignored if you use an autoformatter like `black`.
"E501",
# F706 `return` statement outside of a function/method
"F706",
# E713 [*] Test for membership should be `not in`
"E713",
# E721: do not compare types, use 'isinstance()'
"E721",
# E722: do not use bare 'except'
"E722",
# E741: ambiguous variable name (e.g., 'l', 'I', 'O')
"E741",
# N801: class names should use CapWords
"N801",
# N802: function name should be lowercase
"N802",
# N803: argument name should be lowercase
"N803",
# N805: first argument of classmethod should be named 'cls'
"N805",
# N806: variable in function should be lowercase
"N806",
# F811 Redefinition of unused X from line Y
"F811",
# N815: variable in class scope should not be mixedCase
"N815",
# N818: exception name should end with 'Error'
"N818",
# F821 Undefined name X
"F821",
# F841 Local variable X is assigned to but never used
"F841",
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
[tool.ruff.lint.pydocstyle]
convention = "google" # Accepts: "google", "numpy", or "pep257".