Files
romm/pyproject.toml
Georges-Antoine Assi 02815ec403 Run backend tests in parallel with pytest-xdist
Add pytest-xdist and run the backend test suite across multiple workers
(`-n 4` in CI). Each worker gets its own database so the autouse
`clear_database` fixture can't wipe rows another worker is mid-test with:

- Rootdir `backend/conftest.py` sets a per-worker `DB_NAME`
  (`romm_test_gw0`, ...) before any app module is imported, so each
  worker's engine binds to its own database.
- `tests/conftest.py` creates the per-worker database on demand (mariadb/
  mysql and postgresql paths) just before migrations run.
- The test user's grant is widened to `*.*` (setup.sql + CI) so it can
  `CREATE DATABASE` for the workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:02:47 -04:00

151 lines
4.0 KiB
TOML

[project]
name = "romm"
version = "0.0.1"
description = "A beautiful, powerful, self-hosted rom manager"
authors = [
{ name = "Zurdi", email = "zurdi@romm.app" },
{ name = "Arcane", email = "arcane@romm.app" },
{ name = "Adamantike", email = "adamantike@romm.app" },
]
requires-python = ">=3.13"
readme = "README.md"
license = "AGPL-3.0-only"
dependencies = [
"PyYAML ~= 6.0",
"SQLAlchemy[mariadb-connector,mysql-connector,postgresql-psycopg] ~= 2.0",
"Unidecode ~= 1.3",
"aiohttp~=3.14",
"asyncssh~=2.23",
"alembic ~= 1.16",
"anyio ~= 4.4",
"authlib~=1.6.12",
"colorama ~= 0.4",
"defusedxml ~= 0.7",
"fastapi-pagination[sqlalchemy] ~= 0.15",
"fastapi[standard-no-fastapi-cloud-cli] ~= 0.134.0",
"gunicorn ~= 23.0",
"httpx ~= 0.27",
"itsdangerous ~= 2.2",
"joserfc~=1.6.3",
"mutagen ~= 1.47",
"opentelemetry-distro ~= 0.56",
"opentelemetry-exporter-otlp ~= 1.36",
"opentelemetry-instrumentation-aiohttp-client ~= 0.56",
"opentelemetry-instrumentation-fastapi ~= 0.56",
"opentelemetry-instrumentation-httpx ~= 0.56",
"opentelemetry-instrumentation-redis ~= 0.56",
"opentelemetry-instrumentation-sqlalchemy ~= 0.56",
"passlib[bcrypt] ~= 1.7",
# passlib 1.7 self-checks bcrypt with a >72-byte secret; bcrypt 5+ rejects that.
"bcrypt < 5",
"pillow~=12.2",
"psycopg[c] ~= 3.2",
"pydantic ~= 2.11",
"pydash ~= 8.0",
"python-dotenv~=1.2",
"python-magic ~= 0.4",
"python-socketio ~= 5.11",
"redis ~= 6.2",
"rq ~= 2.7",
# TODO: Move back to upstream `rq-scheduler`, when support for username and SSL settings is added.
# Related PR: https://github.com/rq/rq-scheduler/pull/325
"rq-scheduler @ git+https://github.com/adamantike/rq-scheduler.git@feat/script-options-username-ssl",
"sentry-sdk ~= 2.32",
"starlette ~= 1.0.1",
"streaming-form-data ~= 1.19",
"ua-parser ~= 1.0",
"strsimpy ~= 0.2",
"uvicorn ~= 0.35",
"uvicorn-worker ~= 0.3",
"watchfiles ~= 1.1",
"yarl ~= 1.14",
"zipfile-inflate64 ~= 0.1",
]
[project.optional-dependencies]
dev = [
"ipdb ~= 0.13",
"ipykernel ~= 6.29",
"memray ~= 1.15",
"mypy ~= 1.19",
"pyinstrument ~= 5.0",
"types-colorama ~= 0.4",
"types-passlib ~= 1.7",
"types-pyyaml ~= 6.0",
"types-redis ~= 4.6",
]
test = [
"fakeredis ~= 2.21",
"hypothesis ~= 6.0",
"pytest~=9.0",
"pytest-asyncio ~= 1.1",
"pytest-cov ~= 6.2",
"pytest-env ~= 1.1",
"pytest-mock ~= 3.12",
"pytest-recording ~= 0.13",
"pytest-xdist ~= 3.6",
]
[project.urls]
Homepage = "https://romm.app/"
Source = "https://github.com/rommapp/romm"
[tool.deptry]
known_first_party = [
"__version__",
"adapters",
"config",
"decorators",
"endpoints",
"exceptions",
"handler",
"logger",
"main",
"models",
"startup",
"tasks",
"utils",
]
pep621_dev_dependency_groups = ["dev"]
[tool.deptry.package_module_name_map]
PyYAML = "yaml"
opentelemetry-distro = "opentelemetry"
pillow = "PIL"
python-dotenv = "dotenv"
python-magic = "magic"
python-socketio = "socketio"
[tool.deptry.per_rule_ignores]
DEP002 = [ # DEP002 rule: Project should not contain unused dependencies
# Packages used within the server initialization script.
"gunicorn",
"uvicorn-worker",
"watchfiles",
# OpenTelemetry packages are used via auto-instrumentation.
"opentelemetry-exporter-otlp",
"opentelemetry-instrumentation-aiohttp-client",
"opentelemetry-instrumentation-fastapi",
"opentelemetry-instrumentation-httpx",
"opentelemetry-instrumentation-redis",
"opentelemetry-instrumentation-sqlalchemy",
# Database drivers are used via SQLAlchemy.
"psycopg",
# Pytest plugins are used via pytest only.
"pytest-cov",
"pytest-env",
"pytest-mock",
"pytest-recording",
"pytest-xdist",
]
[tool.uv]
package = false
exclude-newer = "7 days"
# vcrpy >= 8.2.0 is required for aiohttp 3.14 compatibility (the removal of
# `AsyncStreamReaderMixin`); allow it past the rolling 7-day window.
exclude-newer-package = { starlette = "2026-05-22", vcrpy = "2026-06-17" }
[tool.ty.environment]
root = ["./backend"]