]> jfr.im git - yt-dlp.git/blob - pyproject.toml
[build] Bump Pyinstaller to `>=6.7.0` for all builds (#10069)
[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 "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.7.0", # for compat with setuptools>=70
82 ]
83 py2exe = [
84 "py2exe>=0.12",
85 "requests==2.31.*",
86 ]
87
88 [project.urls]
89 Documentation = "https://github.com/yt-dlp/yt-dlp#readme"
90 Repository = "https://github.com/yt-dlp/yt-dlp"
91 Tracker = "https://github.com/yt-dlp/yt-dlp/issues"
92 Funding = "https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators"
93
94 [project.scripts]
95 yt-dlp = "yt_dlp:main"
96
97 [project.entry-points.pyinstaller40]
98 hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
99
100 [tool.hatch.build.targets.sdist]
101 include = [
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 ]
113 artifacts = [
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]
122 packages = ["yt_dlp"]
123 artifacts = ["/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]
133 path = "yt_dlp/version.py"
134 pattern = "_pkg_version = '(?P<version>[^']+)'"
135
136 [tool.hatch.envs.default]
137 features = ["curl-cffi", "default"]
138 dependencies = ["pre-commit"]
139 path = ".venv"
140 installer = "uv"
141
142 [tool.hatch.envs.default.scripts]
143 setup = "pre-commit install --config .pre-commit-hatch.yaml"
144 yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
145
146 [tool.hatch.envs.hatch-static-analysis]
147 detached = true
148 features = ["static-analysis"]
149 dependencies = [] # override hatch ruff version
150 config-path = "pyproject.toml"
151
152 [tool.hatch.envs.hatch-static-analysis.scripts]
153 format-check = "autopep8 --diff {args:.}"
154 format-fix = "autopep8 --in-place {args:.}"
155 lint-check = "ruff check {args:.}"
156 lint-fix = "ruff check --fix {args:.}"
157
158 [tool.hatch.envs.hatch-test]
159 features = ["test"]
160 dependencies = [
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]
167 run = "python -m devscripts.run_tests {args}"
168 run-cov = "echo Code coverage not implemented && exit 1"
169
170 [[tool.hatch.envs.hatch-test.matrix]]
171 python = [
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]
183 line-length = 120
184
185 [tool.ruff.lint]
186 ignore = [
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 ]
192 select = [
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]
204 known-first-party = [
205 "bundle",
206 "devscripts",
207 "test",
208 ]
209 relative-imports-order = "closest-to-furthest"
210
211 [tool.autopep8]
212 max_line_length = 120
213 recursive = true
214 exit-code = true
215 jobs = 0
216 select = [
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]
274 addopts = "-ra -v --strict-markers"
275 markers = [
276 "download",
277 ]