]> jfr.im git - yt-dlp.git/blob - pyproject.toml
[misc] Cleanup (#9765)
[yt-dlp.git] / pyproject.toml
1 [build-system]
2 requires = ["hatchling"]
3 build-backend = "hatchling.build"
4
5 [project]
6 name = "yt-dlp"
7 maintainers = [
8 {name = "pukkandan", email = "pukkandan.ytdlp@gmail.com"},
9 {name = "Grub4K", email = "contact@grub4k.xyz"},
10 {name = "bashonly", email = "bashonly@protonmail.com"},
11 {name = "coletdjnz", email = "coletdjnz@protonmail.com"},
12 ]
13 description = "A feature-rich command-line audio/video downloader"
14 readme = "README.md"
15 requires-python = ">=3.8"
16 keywords = [
17 "youtube-dl",
18 "video-downloader",
19 "youtube-downloader",
20 "sponsorblock",
21 "youtube-dlc",
22 "yt-dlp",
23 ]
24 license = {file = "LICENSE"}
25 classifiers = [
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 ]
42 dynamic = ["version"]
43 dependencies = [
44 "brotli; implementation_name=='cpython'",
45 "brotlicffi; implementation_name!='cpython'",
46 "certifi",
47 "mutagen",
48 "pycryptodomex",
49 "requests>=2.31.0,<3",
50 "urllib3>=1.26.17,<3",
51 "websockets>=12.0",
52 ]
53
54 [project.optional-dependencies]
55 default = []
56 curl-cffi = ["curl-cffi==0.5.10; implementation_name=='cpython'"]
57 secretstorage = [
58 "cffi",
59 "secretstorage",
60 ]
61 build = [
62 "build",
63 "hatchling",
64 "pip",
65 "setuptools>=66.1.0,<70",
66 "wheel",
67 ]
68 dev = [
69 "pre-commit",
70 "yt-dlp[static-analysis]",
71 "yt-dlp[test]",
72 ]
73 static-analysis = [
74 "autopep8~=2.0",
75 "ruff~=0.4.4",
76 ]
77 test = [
78 "pytest~=8.1",
79 ]
80 pyinstaller = [
81 "pyinstaller>=6.3; sys_platform!='darwin'",
82 "pyinstaller==5.13.2; sys_platform=='darwin'", # needed for curl_cffi
83 ]
84 py2exe = [
85 "py2exe>=0.12",
86 "requests==2.31.*",
87 ]
88
89 [project.urls]
90 Documentation = "https://github.com/yt-dlp/yt-dlp#readme"
91 Repository = "https://github.com/yt-dlp/yt-dlp"
92 Tracker = "https://github.com/yt-dlp/yt-dlp/issues"
93 Funding = "https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators"
94
95 [project.scripts]
96 yt-dlp = "yt_dlp:main"
97
98 [project.entry-points.pyinstaller40]
99 hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
100
101 [tool.hatch.build.targets.sdist]
102 include = [
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 ]
114 artifacts = [
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]
123 packages = ["yt_dlp"]
124 artifacts = ["/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]
134 path = "yt_dlp/version.py"
135 pattern = "_pkg_version = '(?P<version>[^']+)'"
136
137 [tool.hatch.envs.default]
138 features = ["curl-cffi", "default"]
139 dependencies = ["pre-commit"]
140 path = ".venv"
141 installer = "uv"
142
143 [tool.hatch.envs.default.scripts]
144 setup = "pre-commit install --config .pre-commit-hatch.yaml"
145 yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
146
147 [tool.hatch.envs.hatch-static-analysis]
148 detached = true
149 features = ["static-analysis"]
150 dependencies = [] # override hatch ruff version
151 config-path = "pyproject.toml"
152
153 [tool.hatch.envs.hatch-static-analysis.scripts]
154 format-check = "autopep8 --diff {args:.}"
155 format-fix = "autopep8 --in-place {args:.}"
156 lint-check = "ruff check {args:.}"
157 lint-fix = "ruff check --fix {args:.}"
158
159 [tool.hatch.envs.hatch-test]
160 features = ["test"]
161 dependencies = [
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]
168 run = "python -m devscripts.run_tests {args}"
169 run-cov = "echo Code coverage not implemented && exit 1"
170
171 [[tool.hatch.envs.hatch-test.matrix]]
172 python = [
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]
184 line-length = 120
185
186 [tool.ruff.lint]
187 ignore = [
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 ]
193 select = [
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]
205 known-first-party = [
206 "bundle",
207 "devscripts",
208 "test",
209 ]
210 relative-imports-order = "closest-to-furthest"
211
212 [tool.autopep8]
213 max_line_length = 120
214 recursive = true
215 exit-code = true
216 jobs = 0
217 select = [
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]
275 addopts = "-ra -v --strict-markers"
276 markers = [
277 "download",
278 ]