]> jfr.im git - yt-dlp.git/blame - pyproject.toml
[misc] Cleanup (#9765)
[yt-dlp.git] / pyproject.toml
CommitLineData
e9df3d42 1[build-system]
775cde82 2requires = ["hatchling"]
3build-backend = "hatchling.build"
4
5[project]
6name = "yt-dlp"
7maintainers = [
8 {name = "pukkandan", email = "pukkandan.ytdlp@gmail.com"},
9 {name = "Grub4K", email = "contact@grub4k.xyz"},
10 {name = "bashonly", email = "bashonly@protonmail.com"},
47ab66db 11 {name = "coletdjnz", email = "coletdjnz@protonmail.com"},
775cde82 12]
388c979a 13description = "A feature-rich command-line audio/video downloader"
775cde82 14readme = "README.md"
15requires-python = ">=3.8"
16keywords = [
17 "youtube-dl",
18 "video-downloader",
19 "youtube-downloader",
20 "sponsorblock",
21 "youtube-dlc",
22 "yt-dlp",
23]
24license = {file = "LICENSE"}
25classifiers = [
26 "Topic :: Multimedia :: Video",
27 "Development Status :: 5 - Production/Stable",
28 "Environment :: Console",
29 "Programming Language :: Python",
30 "Programming Language :: Python :: 3 :: Only",
31 "Programming Language :: Python :: 3.8",
32 "Programming Language :: Python :: 3.9",
33 "Programming Language :: Python :: 3.10",
34 "Programming Language :: Python :: 3.11",
35 "Programming Language :: Python :: 3.12",
36 "Programming Language :: Python :: Implementation",
37 "Programming Language :: Python :: Implementation :: CPython",
38 "Programming Language :: Python :: Implementation :: PyPy",
39 "License :: OSI Approved :: The Unlicense (Unlicense)",
40 "Operating System :: OS Independent",
41]
42dynamic = ["version"]
43dependencies = [
44 "brotli; implementation_name=='cpython'",
45 "brotlicffi; implementation_name!='cpython'",
46 "certifi",
47 "mutagen",
48 "pycryptodomex",
3f799953 49 "requests>=2.31.0,<3",
775cde82 50 "urllib3>=1.26.17,<3",
51 "websockets>=12.0",
52]
53
54[project.optional-dependencies]
cf91400a 55default = []
02483bea 56curl-cffi = ["curl-cffi==0.5.10; implementation_name=='cpython'"]
775cde82 57secretstorage = [
58 "cffi",
59 "secretstorage",
60]
61build = [
62 "build",
63 "hatchling",
64 "pip",
78c57cc0 65 "setuptools>=66.1.0,<70",
775cde82 66 "wheel",
67]
68dev = [
e897bd82
SS
69 "pre-commit",
70 "yt-dlp[static-analysis]",
71 "yt-dlp[test]",
72]
73static-analysis = [
74 "autopep8~=2.0",
75 "ruff~=0.4.4",
76]
77test = [
78 "pytest~=8.1",
775cde82 79]
58dd0f8d 80pyinstaller = [
81 "pyinstaller>=6.3; sys_platform!='darwin'",
82 "pyinstaller==5.13.2; sys_platform=='darwin'", # needed for curl_cffi
83]
3f799953
SS
84py2exe = [
85 "py2exe>=0.12",
86 "requests==2.31.*",
87]
775cde82 88
89[project.urls]
90Documentation = "https://github.com/yt-dlp/yt-dlp#readme"
91Repository = "https://github.com/yt-dlp/yt-dlp"
92Tracker = "https://github.com/yt-dlp/yt-dlp/issues"
93Funding = "https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators"
94
95[project.scripts]
96yt-dlp = "yt_dlp:main"
a1b77842 97
98[project.entry-points.pyinstaller40]
99hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
775cde82 100
101[tool.hatch.build.targets.sdist]
102include = [
103 "/yt_dlp",
104 "/devscripts",
105 "/test",
106 "/.gitignore", # included by default, needed for auto-excludes
107 "/Changelog.md",
108 "/LICENSE", # included as license
109 "/pyproject.toml", # included by default
110 "/README.md", # included as readme
111 "/setup.cfg",
112 "/supportedsites.md",
113]
775cde82 114artifacts = [
115 "/yt_dlp/extractor/lazy_extractors.py",
116 "/completions",
117 "/AUTHORS", # included by default
118 "/README.txt",
119 "/yt-dlp.1",
120]
121
122[tool.hatch.build.targets.wheel]
123packages = ["yt_dlp"]
775cde82 124artifacts = ["/yt_dlp/extractor/lazy_extractors.py"]
125
126[tool.hatch.build.targets.wheel.shared-data]
127"completions/bash/yt-dlp" = "share/bash-completion/completions/yt-dlp"
128"completions/zsh/_yt-dlp" = "share/zsh/site-functions/_yt-dlp"
129"completions/fish/yt-dlp.fish" = "share/fish/vendor_completions.d/yt-dlp.fish"
130"README.txt" = "share/doc/yt_dlp/README.txt"
131"yt-dlp.1" = "share/man/man1/yt-dlp.1"
132
133[tool.hatch.version]
134path = "yt_dlp/version.py"
135pattern = "_pkg_version = '(?P<version>[^']+)'"
e897bd82
SS
136
137[tool.hatch.envs.default]
138features = ["curl-cffi", "default"]
139dependencies = ["pre-commit"]
140path = ".venv"
141installer = "uv"
142
143[tool.hatch.envs.default.scripts]
144setup = "pre-commit install --config .pre-commit-hatch.yaml"
145yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
146
147[tool.hatch.envs.hatch-static-analysis]
148detached = true
149features = ["static-analysis"]
150dependencies = [] # override hatch ruff version
151config-path = "pyproject.toml"
152
153[tool.hatch.envs.hatch-static-analysis.scripts]
154format-check = "autopep8 --diff {args:.}"
155format-fix = "autopep8 --in-place {args:.}"
156lint-check = "ruff check {args:.}"
157lint-fix = "ruff check --fix {args:.}"
158
159[tool.hatch.envs.hatch-test]
160features = ["test"]
161dependencies = [
162 "pytest-randomly~=3.15",
163 "pytest-rerunfailures~=14.0",
164 "pytest-xdist[psutil]~=3.5",
165]
166
167[tool.hatch.envs.hatch-test.scripts]
168run = "python -m devscripts.run_tests {args}"
169run-cov = "echo Code coverage not implemented && exit 1"
170
171[[tool.hatch.envs.hatch-test.matrix]]
172python = [
173 "3.8",
174 "3.9",
175 "3.10",
176 "3.11",
177 "3.12",
178 "pypy3.8",
179 "pypy3.9",
180 "pypy3.10",
181]
182
183[tool.ruff]
184line-length = 120
185
186[tool.ruff.lint]
187ignore = [
188 "E402", # module level import not at top of file
189 "E501", # line too long
190 "E731", # do not assign a lambda expression, use a def
191 "E741", # ambiguous variable name
192]
193select = [
194 "E", # pycodestyle errors
195 "W", # pycodestyle warnings
196 "F", # pyflakes
197 "I", # import order
198]
199
200[tool.ruff.lint.per-file-ignores]
201"devscripts/lazy_load_template.py" = ["F401"]
202"!yt_dlp/extractor/**.py" = ["I"]
203
204[tool.ruff.lint.isort]
205known-first-party = [
206 "bundle",
207 "devscripts",
208 "test",
209]
210relative-imports-order = "closest-to-furthest"
211
212[tool.autopep8]
213max_line_length = 120
214recursive = true
215exit-code = true
216jobs = 0
217select = [
218 "E101",
219 "E112",
220 "E113",
221 "E115",
222 "E116",
223 "E117",
224 "E121",
225 "E122",
226 "E123",
227 "E124",
228 "E125",
229 "E126",
230 "E127",
231 "E128",
232 "E129",
233 "E131",
234 "E201",
235 "E202",
236 "E203",
237 "E211",
238 "E221",
239 "E222",
240 "E223",
241 "E224",
242 "E225",
243 "E226",
244 "E227",
245 "E228",
246 "E231",
247 "E241",
248 "E242",
249 "E251",
250 "E252",
251 "E261",
252 "E262",
253 "E265",
254 "E266",
255 "E271",
256 "E272",
257 "E273",
258 "E274",
259 "E275",
260 "E301",
261 "E302",
262 "E303",
263 "E304",
264 "E305",
265 "E306",
266 "E502",
267 "E701",
268 "E702",
269 "E704",
270 "W391",
271 "W504",
272]
273
274[tool.pytest.ini_options]
275addopts = "-ra -v --strict-markers"
276markers = [
277 "download",
278]