Use setuptools 'entry_points': 'console_scripts' if setuptools is installed (#206)

Replace scripts=['bin/landsat'] with entry_points={'console_scripts':['landsat=landsat.landsat:__main__']} if if setuptools is installed.

This allows cross platform generation of executable scripts. The current use of the distutils scripts argument just copies bin/landsat to (Python dir)\Scripts on Windows.
This commit is contained in:
lpinner
2016-10-20 09:57:15 +11:00
committed by GitHub
parent 362d5b046f
commit 982776f496

View File

@@ -5,8 +5,11 @@
try: try:
from setuptools import setup from setuptools import setup
setup_kwargs = {'entry_points': {'console_scripts':['landsat=landsat.landsat:__main__']}}
except ImportError: except ImportError:
from distutils.core import setup from distutils.core import setup
setup_kwargs = {'scripts': ['bin/landsat']}
from landsat import __version__ from landsat import __version__
@@ -29,7 +32,6 @@ setup(
long_description=readme(), long_description=readme(),
author='Development Seed', author='Development Seed',
author_email='info@developmentseed.org', author_email='info@developmentseed.org',
scripts=['bin/landsat'],
url='https://github.com/developmentseed/landsat-util', url='https://github.com/developmentseed/landsat-util',
packages=['landsat'], packages=['landsat'],
include_package_data=True, include_package_data=True,
@@ -37,5 +39,6 @@ setup(
platforms='Posix; MacOS X; Windows', platforms='Posix; MacOS X; Windows',
install_requires=INSTALL_REQUIRES, install_requires=INSTALL_REQUIRES,
test_suite='nose.collector', test_suite='nose.collector',
tests_require=TEST_REQUIRES tests_require=TEST_REQUIRES,
**setup_kwargs
) )