]>
Commit | Line | Data |
---|---|---|
2f1765c4 | 1 | #!/usr/bin/env python |
dcdb292f | 2 | # coding: utf-8 |
2f1765c4 | 3 | |
58ac65e7 | 4 | from setuptools import setup, Command, find_packages |
6c57e8a0 | 5 | import os.path |
6c57e8a0 | 6 | import warnings |
4efe62a0 | 7 | import sys |
5a9858bf | 8 | from distutils.spawn import spawn |
a32b573c | 9 | |
cefecac1 U |
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')) | |
3d4b08df | 13 | |
7bc877a2 | 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())) | |
770234af | 20 | |
fec89790 | 21 | if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': |
94a538fa | 22 | print("inv") |
fec89790 | 23 | else: |
6c57e8a0 | 24 | files_spec = [ |
cefecac1 U |
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']) | |
6c57e8a0 PH |
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 | ||
fec89790 | 41 | params = { |
6c57e8a0 | 42 | 'data_files': data_files, |
a5741a3f | 43 | } |
94a538fa | 44 | #if setuptools_available: |
cefecac1 | 45 | params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dlc:main']} |
94a538fa U |
46 | #else: |
47 | # params['scripts'] = ['bin/youtube-dlc'] | |
a5741a3f | 48 | |
5a9858bf | 49 | class build_lazy_extractors(Command): |
3d4b08df | 50 | description = 'Build the extractor lazy loading module' |
5a9858bf JMF |
51 | user_options = [] |
52 | ||
53 | def initialize_options(self): | |
54 | pass | |
55 | ||
56 | def finalize_options(self): | |
57 | pass | |
58 | ||
59 | def run(self): | |
60 | spawn( | |
cefecac1 | 61 | [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dlc/extractor/lazy_extractors.py'], |
5a9858bf JMF |
62 | dry_run=self.dry_run, |
63 | ) | |
64 | ||
cc51a7d4 | 65 | setup( |
7bc877a2 | 66 | name="yt-dlp", |
652e7768 | 67 | version=__version__, |
7bc877a2 | 68 | maintainer="pukkandan", |
69 | maintainer_email="pukkandan@gmail.com", | |
3d4b08df S |
70 | description=DESCRIPTION, |
71 | long_description=LONG_DESCRIPTION, | |
7bc877a2 | 72 | long_description_content_type="text/markdown", |
17fa3ee2 | 73 | url="https://github.com/pukkandan/yt-dlp", |
6515018d | 74 | packages=find_packages(exclude=("youtube_dl","test",)), |
7bc877a2 | 75 | project_urls={ |
76 | 'Documentation': 'https://github.com/pukkandan/yt-dlp#yt-dlp', | |
77 | 'Source': 'https://github.com/pukkandan/yt-dlp', | |
78 | 'Tracker': 'https://github.com/pukkandan/yt-dlp/issues', | |
79 | #'Funding': 'https://donate.pypi.org', | |
80 | }, | |
652e7768 | 81 | classifiers=[ |
94a538fa U |
82 | "Topic :: Multimedia :: Video", |
83 | "Development Status :: 5 - Production/Stable", | |
84 | "Environment :: Console", | |
85 | "Programming Language :: Python", | |
86 | "Programming Language :: Python :: 2", | |
87 | "Programming Language :: Python :: 2.6", | |
88 | "Programming Language :: Python :: 2.7", | |
89 | "Programming Language :: Python :: 3", | |
90 | "Programming Language :: Python :: 3.2", | |
91 | "Programming Language :: Python :: 3.3", | |
92 | "Programming Language :: Python :: 3.4", | |
93 | "Programming Language :: Python :: 3.5", | |
94 | "Programming Language :: Python :: 3.6", | |
95 | "Programming Language :: Python :: 3.7", | |
96 | "Programming Language :: Python :: 3.8", | |
97 | "Programming Language :: Python :: Implementation", | |
98 | "Programming Language :: Python :: Implementation :: CPython", | |
99 | "Programming Language :: Python :: Implementation :: IronPython", | |
100 | "Programming Language :: Python :: Implementation :: Jython", | |
101 | "Programming Language :: Python :: Implementation :: PyPy", | |
102 | "License :: Public Domain", | |
103 | "Operating System :: OS Independent", | |
a5741a3f | 104 | ], |
94a538fa U |
105 | python_requires='>=2.6', |
106 | ||
107 | cmdclass={'build_lazy_extractors': build_lazy_extractors}, | |
fec89790 | 108 | **params |
6515018d | 109 | ) |