at main 4.1 kB view raw
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 "beartype>=0.22.8", 33] 34 35requires-python = ">=3.11" 36readme = "README.md" 37license = "Apache-2.0" 38 39keywords = ["music", "streaming", "atproto", "bluesky", "decentralized"] 40 41[dependency-groups] 42dev = [ 43 "dirty-equals>=0.9.0", 44 "ipython>=8.12.3", 45 "pdbpp>=0.10.3", 46 "prek>=0.2.13", 47 "pytest>=8.3.3", 48 "pytest-asyncio>=1.0.0", 49 "pytest-cov>=6.1.1", 50 "pytest-env>=1.1.5", 51 "pytest-timeout>=2.4.0", 52 "pytest-xdist>=3.6.1", 53 "ruff>=0.12.0", 54 "httpx>=0.28.0", 55 "ty>=0.0.1a25", 56] 57 58[build-system] 59requires = ["hatchling", "uv-dynamic-versioning>=0.7.0"] 60build-backend = "hatchling.build" 61 62[tool.hatch.version] 63source = "uv-dynamic-versioning" 64 65[tool.hatch.metadata] 66allow-direct-references = true 67 68[tool.uv-dynamic-versioning] 69vcs = "git" 70style = "pep440" 71bump = true 72fallback-version = "0.0.0" 73 74[tool.pytest.ini_options] 75asyncio_mode = "auto" 76asyncio_default_fixture_loop_scope = "function" 77timeout = 10 78env = [ 79 "RELAY_TEST_MODE=1", 80 "OAUTH_ENCRYPTION_KEY=hnSkDmgbbuK0rt7Ab3eJHAktb18gmebsdwKdTmq9mes=", 81 "LOGFIRE_IGNORE_NO_CONFIG=1", 82 # reduce connection pool for tests to avoid exhausting Neon's connection limit 83 "DATABASE_POOL_SIZE=2", 84 "DATABASE_MAX_OVERFLOW=0", 85 # redis URL for cache tests (uses test-redis from docker-compose) 86 # D: prefix means don't override if already set (e.g., by CI workflow) 87 "D:DOCKET_URL=redis://localhost:6380/0", 88 # disable automatic perpetual task scheduling in tests to avoid event loop issues 89 "DOCKET_SCHEDULE_AUTOMATIC_TASKS=false", 90] 91markers = [ 92 "integration: marks tests as integration tests (deselect with '-m \"not integration\"')", 93] 94pythonpath = ["."] 95testpaths = ["tests"] 96python_files = ["test_*.py", "*_test.py"] 97python_classes = ["Test*"] 98python_functions = ["test_*"] 99filterwarnings = [ 100 "ignore::pydantic.warnings.UnsupportedFieldAttributeWarning", 101] 102 103[tool.ruff.lint] 104fixable = ["ALL"] 105ignore = [ 106 "COM812", 107 "PLR0913", # Too many arguments 108 "SIM102", # Dont require combining if statements 109] 110extend-select = [ 111 "B", # flake8-bugbear 112 "C4", # flake8-comprehensions 113 "I", # isort 114 "PIE", # flake8-pie 115 "RUF", # Ruff-specific 116 "SIM", # flake8-simplify 117 "UP", # pyupgrade 118] 119 120[tool.ruff.lint.per-file-ignores] 121"__init__.py" = ["F401", "I001"] 122"tests/**/*.py" = ["S101"] # Allow assert in tests 123"src/backend/api/**/*.py" = [ 124 "B008", 125] # Allow Depends() and File() in FastAPI route defaults 126"src/backend/main.py" = ["E402"] # Need warnings filter before imports 127 128[tool.coverage.run] 129source = ["src"] 130omit = ["tests/*", "sandbox/*"] 131 132[tool.coverage.report] 133exclude_lines = [ 134 "pragma: no cover", 135 "def __repr__", 136 "raise AssertionError", 137 "raise NotImplementedError", 138 "if __name__ == .__main__.:", 139 "if TYPE_CHECKING:", 140] 141 142[tool.ty.src] 143include = ["src", "tests"] 144exclude = [ 145 "**/node_modules", 146 "**/__pycache__", 147 ".venv", 148 ".git", 149 "dist", 150 "frontend", 151] 152 153[tool.ty.environment] 154python-version = "3.11" 155 156[tool.ty.rules] 157# start with basic checks, can tighten later 158unknown-argument = "ignore" 159no-matching-overload = "ignore"