-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·61 lines (48 loc) · 1.67 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
import sys
try:
from setuptools import setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import pkg_resources
NAME = 'pillowfight'
VERSION = '0.4'
SUMMARY = 'Eases the transition from PIL to Pillow for projects.'
fp = open('README.rst', 'r')
DESCRIPTION = fp.read().strip()
fp.close()
PIL_WARNING = '''
***************************************************************************
The "PIL" library is deprecated in favor of "Pillow", and may not be
supported in a future release.
To switch to "Pillow", you must first uninstall "PIL".
***************************************************************************
'''
# If PIL is installed, use that. Otherwise prefer the newer Pillow library.
pil_req = pkg_resources.Requirement.parse('PIL')
try:
pkg_resources.get_provider(pil_req)
# We found PIL. So, guess we have to use that.
sys.stderr.write('\n%s\n' % PIL_WARNING.strip())
image_lib = 'PIL'
except pkg_resources.DistributionNotFound:
image_lib = 'Pillow>=3.4.2'
if sys.hexversion < 0x02070000:
# Pillow 4.0 requires Python 2.7+. For older versions of Python, we
# can't go higher than 3.x.
image_lib += ',<=3.9999'
elif sys.hexversion < 0x03050000:
# Pillow 7.0 requires Python 3.5+.
image_lib += ',<=6.9999'
setup(name=NAME,
version=VERSION,
license='MIT',
description=SUMMARY,
long_description=DESCRIPTION,
install_requires=[image_lib],
zip_safe=True,
url='https://github.com/beanbaginc/pillowfight',
maintainer='Beanbag, Inc.',
maintainer_email='[email protected]')