1[project] 2name = "backend" 3dynamic = ["version"] 4description = "decentralized music streaming platform built on ATProto" 5authors = [{ name = "zzstoatzz", email = "thrast36@gmail.com" }] 6dependencies = [ 7 "fastapi>=0.115.0", 8 "uvicorn[standard]>=0.34.0", 9 "httpx>=0.28.0", 10 "pydantic>=2.11.0", 11 "pydantic-settings>=2.7.0", 12 "python-dotenv>=1.1.0", 13 "sqlalchemy>=2.0.36", 14 "alembic>=1.14.0", 15 "asyncpg>=0.30.0", 16 "atproto @ git+https://github.com/zzstoatzz/atproto@main", 17 "boto3>=1.37.0", 18 "python-multipart>=0.0.20", 19 "python-jose[cryptography]>=3.3.0", 20 "passlib[bcrypt]>=1.7.4", 21 "psycopg[binary]>=3.2.12", 22 "greenlet>=3.2.4", 23 "logfire[fastapi,sqlalchemy]>=4.14.2", 24 "cachetools>=6.2.1", 25 "pytest-asyncio>=0.25.3", 26 "aioboto3>=15.5.0", 27 "slowapi @ git+https://github.com/zzstoatzz/slowapi.git@fix-deprecation", 28 "orjson>=3.11.4", 29 "mutagen>=1.47.0", 30 "pydocket>=0.15.2", 31 "redis>=7.1.0", 32] 33 34requires-python = ">=3.11" 35readme = "README.md" 36license = "Apache-2.0" 37 38keywords = ["music", "streaming", "atproto", "bluesky", "decentralized"] 39 40[dependency-groups] 41dev = [ 42 "dirty-equals>=0.9.0", 43 "ipython>=8.12.3", 44 "pdbpp>=0.10.3", 45 "prek>=0.2.13", 46 "pytest>=8.3.3", 47 "pytest-asyncio>=1.0.0", 48 "pytest-cov>=6.1.1", 49 "pytest-env>=1.1.5", 50 "pytest-timeout>=2.4.0", 51 "pytest-xdist>=3.6.1", 52 "ruff>=0.12.0", 53 "httpx>=0.28.0", 54 "ty>=0.0.1a25", 55] 56 57[build-system] 58requires = ["hatchling", "uv-dynamic-versioning>=0.7.0"] 59build-backend = "hatchling.build" 60 61[tool.hatch.version] 62source = "uv-dynamic-versioning" 63 64[tool.hatch.metadata] 65allow-direct-references = true 66 67[tool.uv-dynamic-versioning] 68vcs = "git" 69style = "pep440" 70bump = true 71fallback-version = "0.0.0" 72 73[tool.pytest.ini_options] 74asyncio_mode = "auto" 75asyncio_default_fixture_loop_scope = "function" 76timeout = 10 77env = [ 78 "RELAY_TEST_MODE=1", 79 "OAUTH_ENCRYPTION_KEY=hnSkDmgbbuK0rt7Ab3eJHAktb18gmebsdwKdTmq9mes=", 80 "LOGFIRE_IGNORE_NO_CONFIG=1", 81 # reduce connection pool for tests to avoid exhausting Neon's connection limit 82 "DATABASE_POOL_SIZE=2", 83 "DATABASE_MAX_OVERFLOW=0", 84 # redis URL for cache tests (uses test-redis from docker-compose) 85 # D: prefix means don't override if already set (e.g., by CI workflow) 86 "D:DOCKET_URL=redis://localhost:6380/0", 87] 88markers = [ 89 "integration: marks tests as integration tests (deselect with '-m \"not integration\"')", 90] 91pythonpath = ["."] 92testpaths = ["tests"] 93python_files = ["test_*.py", "*_test.py"] 94python_classes = ["Test*"] 95python_functions = ["test_*"] 96filterwarnings = [ 97 "ignore::pydantic.warnings.UnsupportedFieldAttributeWarning", 98] 99 100[tool.ruff.lint] 101fixable = ["ALL"] 102ignore = [ 103 "COM812", 104 "PLR0913", # Too many arguments 105 "SIM102", # Dont require combining if statements 106] 107extend-select = [ 108 "B", # flake8-bugbear 109 "C4", # flake8-comprehensions 110 "I", # isort 111 "PIE", # flake8-pie 112 "RUF", # Ruff-specific 113 "SIM", # flake8-simplify 114 "UP", # pyupgrade 115] 116 117[tool.ruff.lint.per-file-ignores] 118"__init__.py" = ["F401", "I001"] 119"tests/**/*.py" = ["S101"] # Allow assert in tests 120"src/backend/api/**/*.py" = [ 121 "B008", 122] # Allow Depends() and File() in FastAPI route defaults 123"src/backend/main.py" = ["E402"] # Need warnings filter before imports 124 125[tool.coverage.run] 126source = ["src"] 127omit = ["tests/*", "sandbox/*"] 128 129[tool.coverage.report] 130exclude_lines = [ 131 "pragma: no cover", 132 "def __repr__", 133 "raise AssertionError", 134 "raise NotImplementedError", 135 "if __name__ == .__main__.:", 136 "if TYPE_CHECKING:", 137] 138 139[tool.ty.src] 140include = ["src", "tests"] 141exclude = [ 142 "**/node_modules", 143 "**/__pycache__", 144 ".venv", 145 ".git", 146 "dist", 147 "frontend", 148] 149 150[tool.ty.environment] 151python-version = "3.11" 152 153[tool.ty.rules] 154# start with basic checks, can tighten later 155unknown-argument = "ignore" 156no-matching-overload = "ignore"