Merge pull request #1620 from jaimeMF/console_script
authorFilippo Valsorda <filippo.valsorda@gmail.com>
Mon, 28 Oct 2013 06:08:59 +0000 (23:08 -0700)
committerFilippo Valsorda <filippo.valsorda@gmail.com>
Mon, 28 Oct 2013 06:08:59 +0000 (23:08 -0700)
Use the console_scripts entry point if setuptools is available

1  2 
setup.py

diff --combined setup.py
index 2391c527298299a616551d77a3a7a07d764df38d,347a4f2d8090ad85823ca8ca4bae424fcd25a832..f14f9637722e03aceb0aa96a9da1c65d91ef776e
+++ b/setup.py
@@@ -8,6 -8,7 +8,7 @@@ import sy
  
  try:
      from setuptools import setup
+     setuptools_available = True
  except ImportError:
      from distutils.core import setup
  
@@@ -43,13 -44,16 +44,16 @@@ if len(sys.argv) >= 2 and sys.argv[1] =
      params = py2exe_params
  else:
      params = {
-         'scripts': ['bin/youtube-dl'],
          'data_files': [  # Installing system-wide would require sudo...
              ('etc/bash_completion.d', ['youtube-dl.bash-completion']),
              ('share/doc/youtube_dl', ['README.txt']),
              ('share/man/man1/', ['youtube-dl.1'])
          ]
      }
+     if setuptools_available:
+         params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']}
+     else:
+         params['scripts'] = ['bin/youtube-dl']
  
  # Get the version from youtube_dl/version.py without importing the package
  exec(compile(open('youtube_dl/version.py').read(),
@@@ -63,7 -67,6 +67,7 @@@ setup
      ' YouTube.com and other video sites.',
      url='https://github.com/rg3/youtube-dl',
      author='Ricardo Garcia',
 +    author_email='ytdl@yt-dl.org',
      maintainer='Philipp Hagemeister',
      maintainer_email='phihag@phihag.de',
      packages=['youtube_dl', 'youtube_dl.extractor'],