mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-15 05:56:04 +00:00
e63c403623
* docs: simplex-chat-python design and implementation plan * bots: Python wire types codegen * simplex-chat-python: package scaffold * simplex-chat-python: native libsimplex loader * simplex-chat-python: async FFI wrappers * simplex-chat-python: ChatApi with 49 api methods * simplex-chat-python: Bot class with decorators and dispatch * simplex-chat-python: install CLI, example bot, README * simplex-chat-python: audit fixes * bots: regenerate API docs and types Catches up the markdown, TypeScript and Python codegen outputs with two upstream schema changes: - APIConnectPlan.connectionLink became optional (from sh/python-lib audit fixes); cmdString and EBNF syntax now reflect optional parameter. - APIAddGroupRelays command and CRGroupRelaysAdded/CRGroupRelaysAddFailed responses added in #6917 (relay management). The TS and markdown outputs were regenerated when #6917 landed but the Python types module only got the new entries with this regeneration. * core: refresh SQLite query plans after relay_inactive_at migration The M20260507_relay_inactive_at migration (#6917 / #6952) shifted the query plans that 'Save query plans' verifies. Regenerated via the test that owns those snapshots; no behavioral change. * bots: keep APIConnectPlan connectionLink as required parameter The prior audit-fixes commit changed the syntax expression to `Optional ...` because the Haskell field is `connectionLink :: Maybe AConnectionLink`. That misrepresents the API contract: the `Maybe` is purely an internal signal for link-parsing failure (the handler returns `CEInvalidConnReq` on `Nothing`), not API-level optionality. Callers MUST always pass a connection link. Revert the syntax expression to `Param "connectionLink"` and add a comment so the intent is preserved next time someone audits. Regenerates COMMANDS.md, commands.ts and _commands.py to match.
59 lines
1.9 KiB
TOML
59 lines
1.9 KiB
TOML
[build-system]
|
|
requires = ["hatchling>=1.24"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "simplex-chat"
|
|
description = "SimpleX Chat Python library for chat bots"
|
|
readme = "README.md"
|
|
license = "AGPL-3.0-only"
|
|
authors = [{name = "SimpleX Chat"}]
|
|
requires-python = ">=3.11"
|
|
keywords = ["simplex", "messenger", "chat", "privacy", "security", "bots"]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Topic :: Communications :: Chat",
|
|
]
|
|
dynamic = ["version"]
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/simplex-chat/simplex-chat/tree/stable/packages/simplex-chat-python"
|
|
Issues = "https://github.com/simplex-chat/simplex-chat/issues"
|
|
|
|
[project.optional-dependencies]
|
|
test = ["pytest>=8", "pytest-asyncio>=0.23"]
|
|
dev = ["pytest>=8", "pytest-asyncio>=0.23", "pyright>=1.1.380", "ruff>=0.6"]
|
|
|
|
[tool.hatch.version]
|
|
path = "src/simplex_chat/_version.py"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/simplex_chat"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
|
|
[tool.ruff.format]
|
|
# `src/simplex_chat/types/*.py` are generated by the Haskell codegen
|
|
# (bots/src/API/Docs/Generate/Python.hs). Re-formatting them locally
|
|
# would diverge from the generator's output and break `cabal test
|
|
# simplex-chat-test --match Python`. Lint still applies — only format
|
|
# is suppressed.
|
|
exclude = ["src/simplex_chat/types/_*.py"]
|
|
|
|
[tool.pyright]
|
|
# Same rationale: the generated cmd_string helpers use `self.get('x')`
|
|
# call pairs that pyright cannot narrow across (`is not None` followed
|
|
# by re-access). Hand-written code is still strictly checked.
|
|
include = ["src/simplex_chat"]
|
|
exclude = ["src/simplex_chat/types/_*.py", "**/__pycache__", "**/.venv*"]
|