annotate setup.py @ 7:230fb4ae30c7

look for PIL dynamically when running setup.py
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 14 Mar 2011 14:32:06 -0700
parents 0cd9a1362310
children eb0f4870a019
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
1 from setuptools import setup, find_packages
7
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
2 from pkg_resources import require, DistributionNotFound
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
3 import os
0
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
4
2
0676435d1186 include README file; bump version
k0s <k0scist@gmail.com>
parents: 1
diff changeset
5 try:
3
2be0070c6f95 path-independent way of getting the description
k0s <k0scist@gmail.com>
parents: 2
diff changeset
6 filename = os.path.join(os.path.dirname(__file__), 'README.txt')
2be0070c6f95 path-independent way of getting the description
k0s <k0scist@gmail.com>
parents: 2
diff changeset
7 description = file(filename).read()
2
0676435d1186 include README file; bump version
k0s <k0scist@gmail.com>
parents: 1
diff changeset
8 except:
0676435d1186 include README file; bump version
k0s <k0scist@gmail.com>
parents: 1
diff changeset
9 description = ''
0676435d1186 include README file; bump version
k0s <k0scist@gmail.com>
parents: 1
diff changeset
10
7
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
11 # Dependency check at run time
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
12 # If PIL is not found, then it is added in the ``install_requires`` list
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
13 install_requires = [] # Empty list if PIL is found
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
14 try:
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
15 try:
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
16 require('PIL')
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
17 except DistributionNotFound:
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
18 require('Image')
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
19 except DistributionNotFound:
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
20 install_requires = ['PIL']
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
21
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
22 version = '0.1.6'
0
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
23
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
24 setup(name='cropresize',
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
25 version=version,
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
26 description="crop and resize an image without doing the math yourself",
2
0676435d1186 include README file; bump version
k0s <k0scist@gmail.com>
parents: 1
diff changeset
27 long_description=description,
0
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
28 classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
29 keywords='image',
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
30 author='Jeff Hammel',
1
0a2302b6377b correct email
k0s <k0scist@gmail.com>
parents: 0
diff changeset
31 author_email='k0scist@gmail.com',
0
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
32 url='http://pypi.python.org/pypi/cropresize',
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
33 license='GPL',
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
34 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
35 include_package_data=True,
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
36 zip_safe=False,
7
230fb4ae30c7 look for PIL dynamically when running setup.py
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
37 install_requires=install_requires,
0
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
38 entry_points="""
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
39 # -*- Entry points: -*-
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
40 [console_scripts]
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
41 crop-resize = cropresize:main
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
42 """,
0a54e5bd2875 initial import of cropresive from https://svn.openplans.org/svn/standalone/cropresize
k0s <k0scist@gmail.com>
parents:
diff changeset
43 )