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