Mercurial > hg > MakeItSo
annotate 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 |
rev | line source |
---|---|
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
1 """ |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
2 setup packaging script for {{project}} |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
3 """ |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
4 |
102
ad5fd3eb6674
template fixes....not the best, but will do
Jeff Hammel <jhammel@mozilla.com>
parents:
80
diff
changeset
|
5 import os |
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
6 |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
7 version = "0.0" |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
8 dependencies = {{dependencies}} |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
9 |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
10 # allow use of setuptools/distribue or distutils |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
11 kw = {} |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
12 try: |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
13 from setuptools import setup |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
14 kw['entry_points'] = """ |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
15 {{console_scripts}} |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
16 """ |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
17 kw['install_requires'] = dependencies |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
18 except ImportError: |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
19 from distutils.core import setup |
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
20 |
80 | 21 |
22 try: | |
102
ad5fd3eb6674
template fixes....not the best, but will do
Jeff Hammel <jhammel@mozilla.com>
parents:
80
diff
changeset
|
23 here = os.path.dirname(os.path.abspath(__file__)) |
ad5fd3eb6674
template fixes....not the best, but will do
Jeff Hammel <jhammel@mozilla.com>
parents:
80
diff
changeset
|
24 description = file(os.path.join(here, 'README.txt')).read() |
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
25 except IOError: |
80 | 26 description = '' |
27 | |
109
697568ba4a22
make the python package template a little fancier
Jeff Hammel <jhammel@mozilla.com>
parents:
102
diff
changeset
|
28 |
80 | 29 setup(name='{{project}}', |
30 version=version, | |
31 description="{{description}}", | |
32 long_description=description, | |
33 classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers | |
34 author='{{author}}', | |
35 author_email='{{email}}', | |
36 url='{{url}}', | |
102
ad5fd3eb6674
template fixes....not the best, but will do
Jeff Hammel <jhammel@mozilla.com>
parents:
80
diff
changeset
|
37 license='', |
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
38 packages=['{{project}}'], |
80 | 39 include_package_data=True, |
40 zip_safe=False, | |
109
697568ba4a22
make the python package template a little fancier
Jeff Hammel <jhammel@mozilla.com>
parents:
102
diff
changeset
|
41 install_requires=dependencies, |
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
42 **kw |
80 | 43 ) |