]> jfr.im git - yt-dlp.git/blame - setup.py
Move postprocessor into its own package
[yt-dlp.git] / setup.py
CommitLineData
2f1765c4
FV
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
01c62591 4from __future__ import print_function
e646ffe7 5
cc51a7d4 6import pkg_resources
4efe62a0 7import sys
cc51a7d4 8
a32b573c
DC
9try:
10 from setuptools import setup
f4441536 11 setuptools_available = True
a32b573c
DC
12except ImportError:
13 from distutils.core import setup
369a759a 14 setuptools_available = False
a32b573c 15
fec89790 16try:
131842bb
RB
17 # This will create an exe that needs Microsoft Visual C++ 2008
18 # Redistributable Package
fec89790 19 import py2exe
fec89790
FV
20except ImportError:
21 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
22 print("Cannot import py2exe", file=sys.stderr)
23 exit(1)
24
cc51a7d4 25py2exe_options = {
770234af
FV
26 "bundle_files": 1,
27 "compressed": 1,
28 "optimize": 2,
29 "dist_dir": '.',
e646ffe7 30 "dll_excludes": ['w9xpopen.exe'],
770234af 31}
d055fe4c 32
cc51a7d4 33py2exe_console = [{
a5741a3f 34 "script": "./youtube_dl/__main__.py",
770234af
FV
35 "dest_base": "youtube-dl",
36}]
d055fe4c 37
fec89790
FV
38py2exe_params = {
39 'console': py2exe_console,
d055fe4c 40 'options': {"py2exe": py2exe_options},
fec89790
FV
41 'zipfile': None
42}
770234af 43
fec89790
FV
44if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
45 params = py2exe_params
46else:
47 params = {
d055fe4c
RB
48 'data_files': [ # Installing system-wide would require sudo...
49 ('etc/bash_completion.d', ['youtube-dl.bash-completion']),
50 ('share/doc/youtube_dl', ['README.txt']),
b1c9c669 51 ('share/man/man1', ['youtube-dl.1'])
d055fe4c 52 ]
a5741a3f 53 }
f4441536
JMF
54 if setuptools_available:
55 params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']}
56 else:
57 params['scripts'] = ['bin/youtube-dl']
a5741a3f
FV
58
59# Get the version from youtube_dl/version.py without importing the package
d055fe4c
RB
60exec(compile(open('youtube_dl/version.py').read(),
61 'youtube_dl/version.py', 'exec'))
87bec4c7 62
cc51a7d4 63setup(
652e7768
RB
64 name='youtube_dl',
65 version=__version__,
66 description='YouTube video downloader',
67 long_description='Small command-line program to download videos from'
68 ' YouTube.com and other video sites.',
69 url='https://github.com/rg3/youtube-dl',
70 author='Ricardo Garcia',
284acd57 71 author_email='ytdl@yt-dl.org',
652e7768
RB
72 maintainer='Philipp Hagemeister',
73 maintainer_email='phihag@phihag.de',
56327689
PH
74 packages=[
75 'youtube_dl',
76 'youtube_dl.extractor', 'youtube_dl.downloader',
77 'youtube_dl.postprocessor'],
53e89361 78
a5741a3f 79 # Provokes warning on most systems (why?!)
652e7768
RB
80 # test_suite = 'nose.collector',
81 # test_requires = ['nosetest'],
770234af 82
652e7768 83 classifiers=[
2f1765c4
FV
84 "Topic :: Multimedia :: Video",
85 "Development Status :: 5 - Production/Stable",
86 "Environment :: Console",
87 "License :: Public Domain",
88 "Programming Language :: Python :: 2.6",
89 "Programming Language :: Python :: 2.7",
90 "Programming Language :: Python :: 3",
91 "Programming Language :: Python :: 3.3"
a5741a3f
FV
92 ],
93
fec89790 94 **params
cc51a7d4 95)