pyproject.toml 6.0 KB

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