setup.py

changeset 28
1088bb11189f
parent 24
02f21810d43d
     1.1 --- a/setup.py	Wed Apr 24 10:49:54 2013 +0200
     1.2 +++ b/setup.py	Wed Feb 26 12:48:21 2020 +0000
     1.3 @@ -7,8 +7,7 @@
     1.4  It's primarily intended for making Web photo galleries for the sorts of people
     1.5  who don't want to install some PHP monstrosity just to put their photos
     1.6  online. On the assumption that most people will want to tweak their gallery's
     1.7 -appearance, the output is fully customisable using the Cheetah templating
     1.8 -engine.
     1.9 +appearance, the output is customisable using the Cheetah templating engine.
    1.10  
    1.11  Supported image formats are JPEG, PNG, GIF, TIFF, PDF and EPS, with the latter
    1.12  two being converted to PNG for Web display.  Image resizing, renaming and
    1.13 @@ -16,30 +15,21 @@
    1.14  set. Large image sets can be split over several pages.
    1.15  """
    1.16  
    1.17 +## Py3 comptibility
    1.18 +from __future__ import print_function
    1.19 +
    1.20  ## Get setuptools stuff
    1.21 -from distutils.core import setup
    1.22 -
    1.23 -
    1.24 -## Try to import Cheetah templating
    1.25 -try:
    1.26 -    from Cheetah.Template import Template
    1.27 -except Exception, e:
    1.28 -    logging.error("Couldn't import required Cheetah package: please install Cheetah first")
    1.29 -    exit(1)
    1.30 -
    1.31 -## Try to import Python Imaging Library
    1.32 -try:
    1.33 -    import PIL.Image
    1.34 -except Exception, e:
    1.35 -    logging.error("Couldn't import required Python Imaging Library package: please install PIL first")
    1.36 -    exit(1)
    1.37 +#from distutils.core import setup
    1.38 +from setuptools import setup
    1.39  
    1.40  
    1.41  ## Setup definition
    1.42  setup(name = 'emin',
    1.43 -      version = "0.3.4",
    1.44 +      version = "0.4.0",
    1.45        scripts = ['emin'],
    1.46        requires = ["Cheetah", "PIL"],
    1.47 +      install_requires = ["Cheetah3", "Pillow", "pdf2image"],
    1.48 +      python_requires = ">=3",
    1.49        author = 'Andy Buckley',
    1.50        author_email = 'andy@insectnation.org',
    1.51        #url = 'http://www.insectnation.org/projects/emin/',
    1.52 @@ -53,3 +43,25 @@
    1.53                     'Operating System :: OS Independent',
    1.54                     'Programming Language :: Python']
    1.55        )
    1.56 +
    1.57 +
    1.58 +## Try to import Cheetah templating
    1.59 +try:
    1.60 +    import Cheetah
    1.61 +    from Cheetah.Template import Template
    1.62 +except Exception as e:
    1.63 +    print("Couldn't import required Cheetah package")
    1.64 +    exit(1)
    1.65 +
    1.66 +## Try to import Python Imaging Library
    1.67 +try:
    1.68 +    import PIL.Image
    1.69 +except Exception as e:
    1.70 +    print("Couldn't import required Python Imaging Library package")
    1.71 +    exit(1)
    1.72 +
    1.73 +## Try to import pdf2image converter
    1.74 +try:
    1.75 +    import pdf2image
    1.76 +except Exception as e:
    1.77 +    print("Couldn't import optional pdf2image package")

mercurial