]> jfr.im git - yt-dlp.git/blame - pyproject.toml
[build] Bump Pyinstaller to `>=6.7.0` for all builds (#10069)
[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",
5fdd1300 65 "setuptools",
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 = [
5fdd1300 81 "pyinstaller>=6.7.0", # for compat with setuptools>=70
58dd0f8d 82]
3f799953
SS
83py2exe = [
84 "py2exe>=0.12",
85 "requests==2.31.*",
86]
775cde82 87
88[project.urls]
89Documentation = "https://github.com/yt-dlp/yt-dlp#readme"
90Repository = "https://github.com/yt-dlp/yt-dlp"
91Tracker = "https://github.com/yt-dlp/yt-dlp/issues"
92Funding = "https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators"
93
94[project.scripts]
95yt-dlp = "yt_dlp:main"
a1b77842 96
97[project.entry-points.pyinstaller40]
98hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
775cde82 99
100[tool.hatch.build.targets.sdist]
101include = [
102 "/yt_dlp",
103 "/devscripts",
104 "/test",
105 "/.gitignore", # included by default, needed for auto-excludes
106 "/Changelog.md",
107 "/LICENSE", # included as license
108 "/pyproject.toml", # included by default
109 "/README.md", # included as readme
110 "/setup.cfg",
111 "/supportedsites.md",
112]
775cde82 113artifacts = [
114 "/yt_dlp/extractor/lazy_extractors.py",
115 "/completions",
116 "/AUTHORS", # included by default
117 "/README.txt",
118 "/yt-dlp.1",
119]
120
121[tool.hatch.build.targets.wheel]
122packages = ["yt_dlp"]
775cde82 123artifacts = ["/yt_dlp/extractor/lazy_extractors.py"]
124
125[tool.hatch.build.targets.wheel.shared-data]
126"completions/bash/yt-dlp" = "share/bash-completion/completions/yt-dlp"
127"completions/zsh/_yt-dlp" = "share/zsh/site-functions/_yt-dlp"
128"completions/fish/yt-dlp.fish" = "share/fish/vendor_completions.d/yt-dlp.fish"
129"README.txt" = "share/doc/yt_dlp/README.txt"
130"yt-dlp.1" = "share/man/man1/yt-dlp.1"
131
132[tool.hatch.version]
133path = "yt_dlp/version.py"
134pattern = "_pkg_version = '(?P<version>[^']+)'"
e897bd82
SS
135
136[tool.hatch.envs.default]
137features = ["curl-cffi", "default"]
138dependencies = ["pre-commit"]
139path = ".venv"
140installer = "uv"
141
142[tool.hatch.envs.default.scripts]
143setup = "pre-commit install --config .pre-commit-hatch.yaml"
144yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
145
146[tool.hatch.envs.hatch-static-analysis]
147detached = true
148features = ["static-analysis"]
149dependencies = [] # override hatch ruff version
150config-path = "pyproject.toml"
151
152[tool.hatch.envs.hatch-static-analysis.scripts]
153format-check = "autopep8 --diff {args:.}"
154format-fix = "autopep8 --in-place {args:.}"
155lint-check = "ruff check {args:.}"
156lint-fix = "ruff check --fix {args:.}"
157
158[tool.hatch.envs.hatch-test]
159features = ["test"]
160dependencies = [
161 "pytest-randomly~=3.15",
162 "pytest-rerunfailures~=14.0",
163 "pytest-xdist[psutil]~=3.5",
164]
165
166[tool.hatch.envs.hatch-test.scripts]
167run = "python -m devscripts.run_tests {args}"
168run-cov = "echo Code coverage not implemented && exit 1"
169
170[[tool.hatch.envs.hatch-test.matrix]]
171python = [
172 "3.8",
173 "3.9",
174 "3.10",
175 "3.11",
176 "3.12",
177 "pypy3.8",
178 "pypy3.9",
179 "pypy3.10",
180]
181
182[tool.ruff]
183line-length = 120
184
185[tool.ruff.lint]
186ignore = [
187 "E402", # module level import not at top of file
188 "E501", # line too long
189 "E731", # do not assign a lambda expression, use a def
190 "E741", # ambiguous variable name
191]
192select = [
193 "E", # pycodestyle errors
194 "W", # pycodestyle warnings
195 "F", # pyflakes
196 "I", # import order
197]
198
199[tool.ruff.lint.per-file-ignores]
200"devscripts/lazy_load_template.py" = ["F401"]
201"!yt_dlp/extractor/**.py" = ["I"]
202
203[tool.ruff.lint.isort]
204known-first-party = [
205 "bundle",
206 "devscripts",
207 "test",
208]
209relative-imports-order = "closest-to-furthest"
210
211[tool.autopep8]
212max_line_length = 120
213recursive = true
214exit-code = true
215jobs = 0
216select = [
217 "E101",
218 "E112",
219 "E113",
220 "E115",
221 "E116",
222 "E117",
223 "E121",
224 "E122",
225 "E123",
226 "E124",
227 "E125",
228 "E126",
229 "E127",
230 "E128",
231 "E129",
232 "E131",
233 "E201",
234 "E202",
235 "E203",
236 "E211",
237 "E221",
238 "E222",
239 "E223",
240 "E224",
241 "E225",
242 "E226",
243 "E227",
244 "E228",
245 "E231",
246 "E241",
247 "E242",
248 "E251",
249 "E252",
250 "E261",
251 "E262",
252 "E265",
253 "E266",
254 "E271",
255 "E272",
256 "E273",
257 "E274",
258 "E275",
259 "E301",
260 "E302",
261 "E303",
262 "E304",
263 "E305",
264 "E306",
265 "E502",
266 "E701",
267 "E702",
268 "E704",
269 "W391",
270 "W504",
271]
272
273[tool.pytest.ini_options]
274addopts = "-ra -v --strict-markers"
275markers = [
276 "download",
277]