Mercurial > hg > MakeItSo
annotate makeitso/python_package/setup.py @ 231:2bc1dd66dd80
one more time
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 14 Dec 2015 14:14:00 -0800 |
parents | 2ffadba77bb6 |
children | 2eb0a8dc2303 |
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 |
135 | 10 # allow use of setuptools/distribute or distutils |
134
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 |
136
af6ed583a7e9
* multiple install_requires; * use requires for distutils
Jeff Hammel <jhammel@mozilla.com>
parents:
135
diff
changeset
|
20 kw['requires'] = dependencies |
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='', |
137 | 38 packages=['{{package}}'], |
80 | 39 include_package_data=True, |
40 zip_safe=False, | |
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
41 **kw |
80 | 42 ) |