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