annotate makeitso/python_package/setup.py @ 233:ceb5c8ee5bbe

foo
author Jeff Hammel <k0scist@gmail.com>
date Mon, 14 Dec 2015 14:51:27 -0800
parents 2ffadba77bb6
children 2eb0a8dc2303
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
f32ea241e94c misspelling
Jeff Hammel <jhammel@mozilla.com>
parents: 134
diff changeset
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
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
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
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 description = ''
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27
109
697568ba4a22 make the python package template a little fancier
Jeff Hammel <jhammel@mozilla.com>
parents: 102
diff changeset
28
80
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 setup(name='{{project}}',
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 version=version,
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 description="{{description}}",
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 long_description=description,
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 author='{{author}}',
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 author_email='{{email}}',
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
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
2ffadba77bb6 use the right variable
Jeff Hammel <jhammel@mozilla.com>
parents: 136
diff changeset
38 packages=['{{package}}'],
80
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39 include_package_data=True,
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40 zip_safe=False,
134
0e18cdf36a0e make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents: 116
diff changeset
41 **kw
80
0300ed78d630 add a setup.py template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 )