comparison 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
comparison
equal deleted inserted replaced
6:0cd9a1362310 7:230fb4ae30c7
1 from setuptools import setup, find_packages 1 from setuptools import setup, find_packages
2 import sys, os 2 from pkg_resources import require, DistributionNotFound
3 import os
3 4
4 try: 5 try:
5 filename = os.path.join(os.path.dirname(__file__), 'README.txt') 6 filename = os.path.join(os.path.dirname(__file__), 'README.txt')
6 description = file(filename).read() 7 description = file(filename).read()
7 except: 8 except:
8 description = '' 9 description = ''
9 10
10 version = '0.1.5' 11 # Dependency check at run time
12 # If PIL is not found, then it is added in the ``install_requires`` list
13 install_requires = [] # Empty list if PIL is found
14 try:
15 try:
16 require('PIL')
17 except DistributionNotFound:
18 require('Image')
19 except DistributionNotFound:
20 install_requires = ['PIL']
21
22 version = '0.1.6'
11 23
12 setup(name='cropresize', 24 setup(name='cropresize',
13 version=version, 25 version=version,
14 description="crop and resize an image without doing the math yourself", 26 description="crop and resize an image without doing the math yourself",
15 long_description=description, 27 long_description=description,
20 url='http://pypi.python.org/pypi/cropresize', 32 url='http://pypi.python.org/pypi/cropresize',
21 license='GPL', 33 license='GPL',
22 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), 34 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
23 include_package_data=True, 35 include_package_data=True,
24 zip_safe=False, 36 zip_safe=False,
25 install_requires=[ 37 install_requires=install_requires,
26 # -*- Extra requirements: -*-
27 'PIL',
28 ],
29 dependency_links=[
30 "http://dist.repoze.org/PIL-1.1.6.tar.gz",
31 ],
32 entry_points=""" 38 entry_points="""
33 # -*- Entry points: -*- 39 # -*- Entry points: -*-
34 [console_scripts] 40 [console_scripts]
35 crop-resize = cropresize:main 41 crop-resize = cropresize:main
36 """, 42 """,