]> jfr.im git - yt-dlp.git/blob - setup.py
[cleanup] Fix linter and some typos
[yt-dlp.git] / setup.py
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 from setuptools import setup, Command, find_packages
5 import os.path
6 import warnings
7 import sys
8 from distutils.spawn import spawn
9
10
11 # Get the version from yt_dlp/version.py without importing the package
12 exec(compile(open('yt_dlp/version.py').read(),
13 'yt_dlp/version.py', 'exec'))
14
15
16 DESCRIPTION = 'Command-line program to download videos from YouTube.com and many other other video platforms.'
17
18 LONG_DESCRIPTION = '\n\n'.join((
19 'Official repository: <https://github.com/yt-dlp/yt-dlp>',
20 '**PS**: Many links in this document will not work since this is a copy of the README.md from Github',
21 open('README.md', 'r', encoding='utf-8').read()))
22
23 REQUIREMENTS = ['mutagen', 'pycryptodome']
24
25
26 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
27 print('inv')
28 else:
29 files_spec = [
30 ('share/bash-completion/completions', ['completions/bash/yt-dlp']),
31 ('share/zsh/site-functions', ['completions/zsh/_yt-dlp']),
32 ('share/fish/vendor_completions.d', ['completions/fish/yt-dlp.fish']),
33 ('share/doc/yt_dlp', ['README.txt']),
34 ('share/man/man1', ['yt-dlp.1'])
35 ]
36 root = os.path.dirname(os.path.abspath(__file__))
37 data_files = []
38 for dirname, files in files_spec:
39 resfiles = []
40 for fn in files:
41 if not os.path.exists(fn):
42 warnings.warn('Skipping file %s since it is not present. Try running `make pypi-files` first.' % fn)
43 else:
44 resfiles.append(fn)
45 data_files.append((dirname, resfiles))
46
47 params = {
48 'data_files': data_files,
49 }
50 params['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
51
52
53 class build_lazy_extractors(Command):
54 description = 'Build the extractor lazy loading module'
55 user_options = []
56
57 def initialize_options(self):
58 pass
59
60 def finalize_options(self):
61 pass
62
63 def run(self):
64 spawn(
65 [sys.executable, 'devscripts/make_lazy_extractors.py', 'yt_dlp/extractor/lazy_extractors.py'],
66 dry_run=self.dry_run,
67 )
68
69
70 packages = find_packages(exclude=('youtube_dl', 'test', 'ytdlp_plugins'))
71
72 setup(
73 name='yt-dlp',
74 version=__version__,
75 maintainer='pukkandan',
76 maintainer_email='pukkandan.ytdlp@gmail.com',
77 description=DESCRIPTION,
78 long_description=LONG_DESCRIPTION,
79 long_description_content_type='text/markdown',
80 url='https://github.com/yt-dlp/yt-dlp',
81 packages=packages,
82 install_requires=REQUIREMENTS,
83 project_urls={
84 'Documentation': 'https://yt-dlp.readthedocs.io',
85 'Source': 'https://github.com/yt-dlp/yt-dlp',
86 'Tracker': 'https://github.com/yt-dlp/yt-dlp/issues',
87 #'Funding': 'https://donate.pypi.org',
88 },
89 classifiers=[
90 'Topic :: Multimedia :: Video',
91 'Development Status :: 5 - Production/Stable',
92 'Environment :: Console',
93 'Programming Language :: Python',
94 'Programming Language :: Python :: 2',
95 'Programming Language :: Python :: 2.6',
96 'Programming Language :: Python :: 2.7',
97 'Programming Language :: Python :: 3',
98 'Programming Language :: Python :: 3.2',
99 'Programming Language :: Python :: 3.3',
100 'Programming Language :: Python :: 3.4',
101 'Programming Language :: Python :: 3.5',
102 'Programming Language :: Python :: 3.6',
103 'Programming Language :: Python :: 3.7',
104 'Programming Language :: Python :: 3.8',
105 'Programming Language :: Python :: Implementation',
106 'Programming Language :: Python :: Implementation :: CPython',
107 'Programming Language :: Python :: Implementation :: IronPython',
108 'Programming Language :: Python :: Implementation :: Jython',
109 'Programming Language :: Python :: Implementation :: PyPy',
110 'License :: Public Domain',
111 'Operating System :: OS Independent',
112 ],
113 python_requires='>=2.6',
114
115 cmdclass={'build_lazy_extractors': build_lazy_extractors},
116 **params
117 )