view 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
line wrap: on
line source

from setuptools import setup, find_packages
from pkg_resources import require, DistributionNotFound
import os

try:
    filename = os.path.join(os.path.dirname(__file__), 'README.txt')
    description = file(filename).read()
except:
    description = ''

# Dependency check at run time
# If PIL is not found, then it is added in the ``install_requires`` list
install_requires = []   # Empty list if PIL is found
try:
    try:
        require('PIL')
    except DistributionNotFound:
        require('Image')
except DistributionNotFound:
    install_requires = ['PIL']

version = '0.1.6'

setup(name='cropresize',
      version=version,
      description="crop and resize an image without doing the math yourself",
      long_description=description,
      classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
      keywords='image',
      author='Jeff Hammel',
      author_email='k0scist@gmail.com',
      url='http://pypi.python.org/pypi/cropresize',
      license='GPL',
      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
      include_package_data=True,
      zip_safe=False,
      install_requires=install_requires,
      entry_points="""
      # -*- Entry points: -*-
      [console_scripts]
      crop-resize = cropresize:main
      """,
      )