Mercurial > hg > MakeItSo
comparison makeitso/python_package/setup.py @ 134:0e18cdf36a0e
make the python package distutils compatible
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sun, 19 Feb 2012 22:27:42 -0800 |
| parents | 908e9a653668 |
| children | f32ea241e94c |
comparison
equal
deleted
inserted
replaced
| 133:cd51ef9288ea | 134:0e18cdf36a0e |
|---|---|
| 1 """ | |
| 2 setup packaging script for {{project}} | |
| 3 """ | |
| 4 | |
| 1 import os | 5 import os |
| 2 from setuptools import setup, find_packages | 6 |
| 7 version = "0.0" | |
| 8 dependencies = {{dependencies}} | |
| 9 | |
| 10 # allow use of setuptools/distribue or distutils | |
| 11 kw = {} | |
| 12 try: | |
| 13 from setuptools import setup | |
| 14 kw['entry_points'] = """ | |
| 15 {{console_scripts}} | |
| 16 """ | |
| 17 kw['install_requires'] = dependencies | |
| 18 except ImportError: | |
| 19 from distutils.core import setup | |
| 20 | |
| 3 | 21 |
| 4 try: | 22 try: |
| 5 here = os.path.dirname(os.path.abspath(__file__)) | 23 here = os.path.dirname(os.path.abspath(__file__)) |
| 6 description = file(os.path.join(here, 'README.txt')).read() | 24 description = file(os.path.join(here, 'README.txt')).read() |
| 7 except IOError: | 25 except IOError: |
| 8 description = '' | 26 description = '' |
| 9 | 27 |
| 10 version = "0.0" | |
| 11 | |
| 12 dependencies = {{dependencies}} | |
| 13 | 28 |
| 14 setup(name='{{project}}', | 29 setup(name='{{project}}', |
| 15 version=version, | 30 version=version, |
| 16 description="{{description}}", | 31 description="{{description}}", |
| 17 long_description=description, | 32 long_description=description, |
| 18 classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers | 33 classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers |
| 19 author='{{author}}', | 34 author='{{author}}', |
| 20 author_email='{{email}}', | 35 author_email='{{email}}', |
| 21 url='{{url}}', | 36 url='{{url}}', |
| 22 license='', | 37 license='', |
| 23 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), | 38 packages=['{{project}}'], |
| 24 include_package_data=True, | 39 include_package_data=True, |
| 25 zip_safe=False, | 40 zip_safe=False, |
| 26 install_requires=dependencies, | 41 install_requires=dependencies, |
| 27 entry_points=""" | 42 **kw |
| 28 # -*- Entry points: -*- | |
| 29 | |
| 30 {{console_scripts}} | |
| 31 """, | |
| 32 ) | 43 ) |
| 33 |
