Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
166 lines (149 loc) · 5.78 KB
/
Copy pathpyproject.toml
File metadata and controls
166 lines (149 loc) · 5.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[project]
name = "streamrip"
version = "2.6.8"
description = "A fast, all-in-one scriptable music downloader for Qobuz, Deezer, Tidal, SoundCloud, and Spotify."
authors = [{ name = "nathom", email = "nathanthomas707@gmail.com" }]
maintainers = [{ name = "Stensel8", email = "stentijhuis@protonmail.com" }]
license = "GPL-3.0-only"
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.15,<3.16"
keywords = ["hi-res", "free", "music", "download"]
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.15",
]
dependencies = [
"mutagen>=1.48,<2",
"tomlkit>=0.15,<1",
"pathvalidate>=3.3,<4",
"textual>=8.2.8,<9",
"textual-image>=0.14.1,<0.15",
"Pillow>=13,<14",
"deezer-py>=1.3.7,<2",
"pycryptodomex>=3.23,<4",
"m3u8>=6,<7",
"aiofiles>=25.1",
"aiohttp>=3.14,<4",
"aiolimiter>=1.2,<2",
"rich>=15",
"click>=8.4,<9",
"requests>=2.34,<3",
# Spotify only supplies the metadata: its audio is found on YouTube Music
# (ytmusicapi) and downloaded from there with yt-dlp. YouTube's streams need
# a solver script (yt-dlp-ejs) that yt-dlp only accepts at the exact version
# it was released with, and a JavaScript runtime. They are pinned together
# and bumped together. yt-dlp's "default" extra is not used: it also pulls in
# brotli, which has no wheel for Python 3.15, only to unpack the odd
# brotli-compressed page.
"ytmusicapi>=1.12,<2",
"yt-dlp==2026.10.26",
"yt-dlp-ejs==0.8.0",
"websockets>=17",
# The CA bundle every connection is checked against, on every system alike.
"certifi>=2026.10.19",
]
[project.optional-dependencies]
# Drives a browser for the automatic Qobuz and Deezer logins: an already
# installed Chrome-family browser when there is one (no download), or its own
# browser after asking, when there isn't. It needs a screen to show the window
# on, so the container image leaves it out; the installers include it.
browser = ["playwright>=1.64,<2"]
# A prebuilt ffmpeg, for when there's no system ffmpeg (or none on PATH).
ffmpeg = ["imageio-ffmpeg>=0.6"]
[project.scripts]
streamrip = "streamrip.rip:rip"
[project.urls]
Homepage = "https://github.com/Stensel8/streamrip"
Repository = "https://github.com/Stensel8/streamrip"
"Bug Reports" = "https://github.com/Stensel8/streamrip/issues"
Upstream = "https://github.com/nathom/streamrip"
[dependency-groups]
dev = [
"ruff==0.17.3",
"pytest==9.2.0",
"pytest-mock==3.17.0",
"pytest-asyncio==1.4.1.post1",
]
[tool.pytest.ini_options]
minversion = "9.1"
addopts = "-ra -q"
testpaths = ["tests"]
log_level = "DEBUG"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"real_browser: drives a real Chrome-family browser, skipped when none is installed",
"login: about logins, tokens and sessions; CI leaves them out, `checks/run.py login` runs them",
]
[build-system]
requires = ["uv_build>=0.13.5,<0.14"]
build-backend = "uv_build"
[tool.uv]
# The uv that wrote uv.lock's format; an older one fails with this, not on the lock.
required-version = ">=0.13"
[tool.uv.build-backend]
# The package is streamrip/ at the top of the checkout, not under src/.
module-root = ""
[tool.ruff]
target-version = "py315"
[tool.ruff.lint]
# Preview rules only where they are named below, not every rule's preview.
preview = true
explicit-preview-rules = true
select = [
"E4", "E7", "E9", "F", "I", "UP", "ASYNC", "N", "RUF", "ERA001", "PTH",
"B", "C4", "FURB", "PERF", "PIE", "RET", "SIM",
# Names that shadow a builtin, and pytest's own style.
"A", "PT",
# Imports only annotations need are lazy (PEP 810): with deferred
# annotations (PEP 649) they are never loaded at run time.
"TC",
# A lazy import used at import time anyway, or an import hidden in a
# function: either is a top-level `lazy import`.
"TID255", "PLC0415",
# Log arguments, not f-strings: formatted only when the line is shown.
"G004",
# Mistakes waiting to happen.
"PLW1510", "PLW1514", "PLW2901", "RUF052", "RUF056", "TRY300",
# Simpler code.
"FURB140", "ISC004", "PLC0207", "PLR0402", "PLR6201", "RUF039",
# Not: ARG002 and PLR6301 (they take interface methods and hooks, such as
# Client.get_lyrics or Textual's, for mistakes), RUF029 (callbacks that must
# be async), TRY301 (run_ffmpeg raises inside its try to clean up), PGH003
# (no type checker runs here to name codes for).
]
ignore = [
# os.path.isfile/getsize in async code are cheap stat calls, not I/O worth a
# thread hop.
"ASYNC240",
# Media.preprocess and postprocess are hooks a subclass may leave out.
"B027",
# A class in cast() is a plain name, not a string.
"TC006",
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
# Tests read small fixture files synchronously and keep explanatory comments.
# Their fakes mirror real signatures (A002), and some import where they patch.
"tests/**" = ["ASYNC230", "ERA001", "RUF012", "A002", "PLC0415"]
# Starts under any python and imports mutagen only once it runs in the
# project's environment (where `lazy import` is not yet valid syntax).
"checks/run.py" = ["PLC0415"]
# An optional dependency is imported where it is probed, inside the try that
# handles its absence (a lazy import would fail outside it, at first use).
"streamrip/{rip/browser_login,rip/cover_preview,utils/ffmpeg_utils}.py" = ["PLC0415"]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"