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