setup: Move pseudo-docstring to a proper comment.
[youtube-dl] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 from __future__ import print_function
5
6 import pkg_resources
7 import sys
8
9 try:
10     from setuptools import setup
11 except ImportError:
12     from distutils.core import setup
13
14 try:
15     # This will create an exe that needs Microsoft Visual C++ 2008
16     # Redistributable Package
17     import py2exe
18 except ImportError:
19     if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
20         print("Cannot import py2exe", file=sys.stderr)
21         exit(1)
22
23 py2exe_options = {
24     "bundle_files": 1,
25     "compressed": 1,
26     "optimize": 2,
27     "dist_dir": '.',
28     "dll_excludes": ['w9xpopen.exe'],
29 }
30 py2exe_console = [{
31     "script": "./youtube_dl/__main__.py",
32     "dest_base": "youtube-dl",
33 }]
34 py2exe_params = {
35     'console': py2exe_console,
36     'options': { "py2exe": py2exe_options },
37     'zipfile': None
38 }
39
40 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
41     params = py2exe_params
42 else:
43     params = {
44         'scripts': ['bin/youtube-dl'],
45         'data_files': [('etc/bash_completion.d', ['youtube-dl.bash-completion']), # Installing system-wide would require sudo...
46                        ('share/doc/youtube_dl', ['README.txt']),
47                        ('share/man/man1/', ['youtube-dl.1'])]
48     }
49
50 # Get the version from youtube_dl/version.py without importing the package
51 exec(compile(open('youtube_dl/version.py').read(), 'youtube_dl/version.py', 'exec'))
52
53 setup(
54     name = 'youtube_dl',
55     version = __version__,
56     description = 'YouTube video downloader',
57     long_description = 'Small command-line program to download videos from YouTube.com and other video sites.',
58     url = 'https://github.com/rg3/youtube-dl',
59     author = 'Ricardo Garcia',
60     maintainer = 'Philipp Hagemeister',
61     maintainer_email = 'phihag@phihag.de',
62     packages = ['youtube_dl', 'youtube_dl.extractor'],
63
64     # Provokes warning on most systems (why?!)
65     #test_suite = 'nose.collector',
66     #test_requires = ['nosetest'],
67
68     classifiers = [
69         "Topic :: Multimedia :: Video",
70         "Development Status :: 5 - Production/Stable",
71         "Environment :: Console",
72         "License :: Public Domain",
73         "Programming Language :: Python :: 2.6",
74         "Programming Language :: Python :: 2.7",
75         "Programming Language :: Python :: 3",
76         "Programming Language :: Python :: 3.3"
77     ],
78
79     **params
80 )