Files
college-infos/pyproject.toml
Antoine Van Elstraete 1962e13eba feat: implement XmppChannel and SyncXmppChannel (M10-U4+U5)
XmppChannel sends direct messages via slixmpp ClientXMPP with:
- _format_message: 5 emoji sections (synthèse, agenda, devoirs, messages, infos)
  with sanitize_plaintext on all content (SEC-XMPP-06)
- send_async: public async method with connect, STARTTLS verification,
  send_message, disconnect lifecycle (D1, SEC-XMPP-04)
- send: sync wrapper via asyncio.run() for direct callers

SyncXmppChannel adapts async XmppChannel for synchronous pipeline use (D4):
- asyncio.run() when no event loop running (nominal pipeline)
- daemon thread with timeout when event loop already running
- Returns False on any error, never raises (non-blocking)

Security:
- auto_reconnect=False, failed_auth → disconnect + PipelineWarning (SEC-XMPP-04)
- __cause__ and __context__ cleared on all PipelineWarning raises (SEC-XMPP-05)
- redact_secrets with extra_secrets=[jid, password, to] on all logs (SEC-XMPP-02)
- STARTTLS features check post-connection, disconnect on failure (D1)
- dry-run mode logs redacted message without connecting

28 unit tests (20 channel + 8 adapter) covering success, errors, security.

Co-authored-by: opencode/test-engineer <test-engineer@agents.invalid>
Co-authored-by: opencode/coder <coder@agents.invalid>
2026-09-07 23:28:18 +02:00

132 lines
3.1 KiB
TOML

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "pronote-sync"
version = "0.1.0"
description = "Synchronisation Pronote → CalDAV + XMPP"
license = {text = "MIT"}
requires-python = ">=3.13.5"
authors = [
{name = "Votre Nom", email = "votre@email.com"}
]
keywords = ["pronote", "caldav", "xmpp", "sync", "school"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Office/Business :: Scheduling",
"Topic :: Communications :: Chat",
"Topic :: Utilities",
]
dependencies = [
"requests>=2.31.0",
"icalendar>=5.0.0",
"caldav>=1.3.0",
"slixmpp>=1.8.0",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"pronotepy>=2.15.0",
"openai>=1.0.0",
"httpx>=0.25.0",
"feedparser>=6.0.0",
"beautifulsoup4>=4.12.0",
]
[project.optional-dependencies]
ai-litellm = ["litellm>=1.0"]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.0.0",
"requests-mock>=1.11.0",
"aioresponses>=0.7.0",
"bandit>=1.7.0",
"safety>=2.0.0",
"pre-commit>=3.0.0",
"detect-secrets>=1.4.0",
"ruff>=0.4.0",
"mypy>=1.8.0",
]
[project.scripts]
pronote-sync = "pronote_sync.cli.main:main"
[project.urls]
Homepage = "https://github.com/votre-utilisateur/pronote-sync"
Documentation = "https://github.com/votre-utilisateur/pronote-sync#readme"
Repository = "https://github.com/votre-utilisateur/pronote-sync"
Issues = "https://github.com/votre-utilisateur/pronote-sync/issues"
[tool.setuptools.packages.find]
where = ["."]
include = ["pronote_sync*"]
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
[tool.coverage.run]
source = ["pronote_sync"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
fail_under = 90
[tool.bandit]
exclude_dirs = ["tests", "venv"]
skips = ["B101"] # Ignorer les assertions (utilisées dans les tests)
[tool.ruff]
line-length = 100
target-version = "py313"
# Exclure la documentation markdown (ruff format ne doit pas toucher aux blocs de code Python inclus)
extend-exclude = ["GUIDE_DEV_PYTHON.md"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (géré par line-length)
]
[tool.mypy]
python_version = "3.13"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
strict = true
[[tool.mypy.overrides]]
module = "litellm"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "slixmpp"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "openai.*"
follow_imports = "skip"
ignore_missing_imports = true