Mercurial > hg > MakeItSo
annotate makeitso/python_package/setup.py @ 268:64979cfff465 default tip
some py3 fixes
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 29 May 2018 15:28:41 -0700 |
parents | d3852c5beff9 |
children |
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__)) |
245 | 24 description = open(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, |
265
d3852c5beff9
https://docs.pytest.org/en/latest/goodpractices.html
Jeff Hammel <k0scist@gmail.com>
parents:
246
diff
changeset
|
40 setup_requires=['pytest-runner'], |
d3852c5beff9
https://docs.pytest.org/en/latest/goodpractices.html
Jeff Hammel <k0scist@gmail.com>
parents:
246
diff
changeset
|
41 tests_require=['tox', 'pytest'], |
80 | 42 zip_safe=False, |
134
0e18cdf36a0e
make the python package distutils compatible
Jeff Hammel <jhammel@mozilla.com>
parents:
116
diff
changeset
|
43 **kw |
80 | 44 ) |