annotate setup.py @ 0:bf637ccfcae5 default tip

initial stub
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 04 Jul 2012 12:53:24 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 setup packaging script for memeomatic
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 import os
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 from pkg_resources import require, DistributionNotFound
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 version = "0.0"
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 dependencies = ['webob']
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 # Dependency check at run time
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 # If PIL is not found, then it is added in the ``install_requires`` list
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 install_requires = [] # Empty list if PIL is found
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 try:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 try:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 require('PIL')
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 except DistributionNotFound:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 require('Image')
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 except DistributionNotFound:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 install_requires = ['PIL']
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 # allow use of setuptools/distribute or distutils
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 kw = {}
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 try:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 from setuptools import setup
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 kw['entry_points'] = """
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 [console_scripts]
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 meme-o-matic = memeomatic.main:main
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 """
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 kw['install_requires'] = dependencies
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 except ImportError:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 from distutils.core import setup
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 kw['requires'] = dependencies
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 try:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36 here = os.path.dirname(os.path.abspath(__file__))
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 description = file(os.path.join(here, 'README.txt')).read()
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38 except IOError:
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39 description = ''
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 setup(name='memeomatic',
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 version=version,
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
44 description="RESTful and CLI meme generator",
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45 long_description=description,
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46 classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47 author='Jeff Hammel',
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48 author_email='jhammel@mozilla.com',
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
49 url='http://k0s.org/hg/memeomatic',
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
50 license='',
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
51 packages=['memeomatic'],
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
52 include_package_data=True,
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
53 zip_safe=False,
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
54 **kw
bf637ccfcae5 initial stub
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
55 )