]>
Commit | Line | Data |
---|---|---|
2f1765c4 | 1 | #!/usr/bin/env python |
dcdb292f | 2 | # coding: utf-8 |
2f1765c4 | 3 | |
94a538fa | 4 | from setuptools import setup, Command |
6c57e8a0 | 5 | import os.path |
6c57e8a0 | 6 | import warnings |
4efe62a0 | 7 | import sys |
5a9858bf | 8 | from distutils.spawn import spawn |
a32b573c | 9 | |
3d4b08df S |
10 | # Get the version from youtube_dl/version.py without importing the package |
11 | exec(compile(open('youtube_dl/version.py').read(), | |
12 | 'youtube_dl/version.py', 'exec')) | |
13 | ||
94a538fa U |
14 | DESCRIPTION = 'Media downloader supporting various sites such as youtube' |
15 | LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.' | |
770234af | 16 | |
fec89790 | 17 | if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': |
94a538fa | 18 | print("inv") |
fec89790 | 19 | else: |
6c57e8a0 PH |
20 | files_spec = [ |
21 | ('etc/bash_completion.d', ['youtube-dl.bash-completion']), | |
56d1912f | 22 | ('etc/fish/completions', ['youtube-dl.fish']), |
6c57e8a0 PH |
23 | ('share/doc/youtube_dl', ['README.txt']), |
24 | ('share/man/man1', ['youtube-dl.1']) | |
25 | ] | |
26 | root = os.path.dirname(os.path.abspath(__file__)) | |
27 | data_files = [] | |
28 | for dirname, files in files_spec: | |
29 | resfiles = [] | |
30 | for fn in files: | |
31 | if not os.path.exists(fn): | |
32 | warnings.warn('Skipping file %s since it is not present. Type make to build all automatically generated files.' % fn) | |
33 | else: | |
34 | resfiles.append(fn) | |
35 | data_files.append((dirname, resfiles)) | |
36 | ||
fec89790 | 37 | params = { |
6c57e8a0 | 38 | 'data_files': data_files, |
a5741a3f | 39 | } |
94a538fa U |
40 | #if setuptools_available: |
41 | params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dl:main']} | |
42 | #else: | |
43 | # params['scripts'] = ['bin/youtube-dlc'] | |
a5741a3f | 44 | |
5a9858bf | 45 | class build_lazy_extractors(Command): |
3d4b08df | 46 | description = 'Build the extractor lazy loading module' |
5a9858bf JMF |
47 | user_options = [] |
48 | ||
49 | def initialize_options(self): | |
50 | pass | |
51 | ||
52 | def finalize_options(self): | |
53 | pass | |
54 | ||
55 | def run(self): | |
56 | spawn( | |
57 | [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], | |
58 | dry_run=self.dry_run, | |
59 | ) | |
60 | ||
cc51a7d4 | 61 | setup( |
94a538fa | 62 | name="youtube_dlc", |
652e7768 | 63 | version=__version__, |
94a538fa U |
64 | maintainer="Tom-Oliver Heidel", |
65 | maintainer_email="theidel@uni-bremen.de", | |
3d4b08df S |
66 | description=DESCRIPTION, |
67 | long_description=LONG_DESCRIPTION, | |
94a538fa U |
68 | # long_description_content_type="text/markdown", |
69 | url="https://github.com/blackjack4494/youtube-dlc", | |
70 | # packages=setuptools.find_packages(), | |
71 | packages=[ | |
56327689 PH |
72 | 'youtube_dl', |
73 | 'youtube_dl.extractor', 'youtube_dl.downloader', | |
74 | 'youtube_dl.postprocessor'], | |
652e7768 | 75 | classifiers=[ |
94a538fa U |
76 | "Topic :: Multimedia :: Video", |
77 | "Development Status :: 5 - Production/Stable", | |
78 | "Environment :: Console", | |
79 | "Programming Language :: Python", | |
80 | "Programming Language :: Python :: 2", | |
81 | "Programming Language :: Python :: 2.6", | |
82 | "Programming Language :: Python :: 2.7", | |
83 | "Programming Language :: Python :: 3", | |
84 | "Programming Language :: Python :: 3.2", | |
85 | "Programming Language :: Python :: 3.3", | |
86 | "Programming Language :: Python :: 3.4", | |
87 | "Programming Language :: Python :: 3.5", | |
88 | "Programming Language :: Python :: 3.6", | |
89 | "Programming Language :: Python :: 3.7", | |
90 | "Programming Language :: Python :: 3.8", | |
91 | "Programming Language :: Python :: Implementation", | |
92 | "Programming Language :: Python :: Implementation :: CPython", | |
93 | "Programming Language :: Python :: Implementation :: IronPython", | |
94 | "Programming Language :: Python :: Implementation :: Jython", | |
95 | "Programming Language :: Python :: Implementation :: PyPy", | |
96 | "License :: Public Domain", | |
97 | "Operating System :: OS Independent", | |
a5741a3f | 98 | ], |
94a538fa U |
99 | python_requires='>=2.6', |
100 | ||
101 | cmdclass={'build_lazy_extractors': build_lazy_extractors}, | |
fec89790 | 102 | **params |
94a538fa | 103 | ) |