pyproject.toml and aioconsole

- Python 3.13+ is required now
- Shortened dependencies list in pyproject.toml
- peewee and aioconsole are no longer depended on
- Default password getter does not ask for password interactively anymore
- Default environment variable for password is MAB_PASSWORD now (was MATRIX_PASSWORD)
This commit is contained in:
2026-12-01 20:20:50 +03:00
parent 2ace008068
commit d442aa7322
3 changed files with 6 additions and 41 deletions

View File

@@ -10,46 +10,17 @@ authors = [
] ]
description = "Very simple async matrix bot library" description = "Very simple async matrix bot library"
readme = "README.md" readme = "README.md"
requires-python = ">=3.12" requires-python = ">=3.13"
classifiers = [ classifiers = [
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Operating System :: OS Independent", "Operating System :: OS Independent",
] ]
dependencies = [ dependencies = [
"aioconsole==0.8.2", "matrix-nio[e2e]==0.26.0",
"aiofiles==25.1.0",
"aiohappyeyeballs==2.7.1",
"aiohttp==3.14.3",
"aiohttp_socks==0.12.0",
"aiosignal==1.4.0",
"aiosqlite==0.22.1", "aiosqlite==0.22.1",
"atomicwrites==1.4.1",
"attrs==26.1.0",
"build==1.5.0",
"cachetools==7.1.7",
"frozenlist==1.8.0",
"h11==0.16.0",
"h2==4.4.1",
"hpack==4.2.0",
"hyperframe==6.1.0",
"idna==3.19",
"jsonschema==4.26.0",
"jsonschema-specifications==2025.9.1",
"matrix-nio==0.26.0",
"multidict==6.7.1",
"packaging==26.3",
"peewee==3.19.0",
"propcache==0.5.2",
"pycryptodome==3.23.0",
"pyproject_hooks==1.2.0",
"python-socks==3.0.0",
"referencing==0.37.0",
"rpds-py==2026.6.3",
"unpaddedbase64==2.1.0",
"vodozemac==0.10.0",
"yarl==1.24.5",
"python-magic==0.4.27", "python-magic==0.4.27",
"pillow==12.3.0" "pillow==12.3.0",
"pydantic==2.14.4"
] ]
[project.urls] [project.urls]

View File

@@ -1,5 +1,4 @@
import asyncio import asyncio
import aioconsole
import logging import logging
import os import os
from ._database import _Database from ._database import _Database
@@ -20,10 +19,8 @@ class ClientAuth:
async def _default_password_callback(self) -> str: async def _default_password_callback(self) -> str:
if self._config is None: if self._config is None:
raise RuntimeError("No config") raise RuntimeError("No config")
if "MATRIX_PASSWORD" in os.environ: if "MAB_PASSWORD" in os.environ:
return os.environ["MATRIX_PASSWORD"] return os.environ["MAB_PASSWORD"]
if self._config.allow_ainput_password:
return await aioconsole.ainput("Matrix password: ")
raise RuntimeError("Can't get password") raise RuntimeError("Can't get password")
async def _login_using_session_data(self, client: AsyncClient) -> None: async def _login_using_session_data(self, client: AsyncClient) -> None:

View File

@@ -31,9 +31,6 @@ class MatrixBotConfig:
auto_ffmpeg: bool = True auto_ffmpeg: bool = True
"""Enabled automatic `ffmpeg` execution to generate some media (e.g. thumbnails)""" """Enabled automatic `ffmpeg` execution to generate some media (e.g. thumbnails)"""
allow_ainput_password: bool = True
"""Allow `aioconsole.ainput` usage to get user password"""
client_sync_period_ms: int = 5000 client_sync_period_ms: int = 5000
"""Sync period for `nio.AsyncClient` in milliseconds""" """Sync period for `nio.AsyncClient` in milliseconds"""