mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 18:25:32 +08:00
Add pillow to requirements (but allow for PIL)
This commit is contained in:
@@ -4,3 +4,4 @@ numpy>=1.6
|
||||
scipy>=0.9
|
||||
six>=1.3
|
||||
networkx>=1.6.2
|
||||
pillow>=1.1.7
|
||||
|
||||
@@ -80,7 +80,6 @@ version='%s'
|
||||
|
||||
|
||||
def get_package_version(package):
|
||||
version = []
|
||||
for version_attr in ('version', 'VERSION', '__version__'):
|
||||
version_info = getattr(package, version_attr, None)
|
||||
try:
|
||||
@@ -105,8 +104,11 @@ def check_requirements():
|
||||
if package_name == 'cython':
|
||||
package_name = 'Cython'
|
||||
dep_error = False
|
||||
if package_name.lower() == 'pillow':
|
||||
package_name = 'PIL.Image'
|
||||
try:
|
||||
package = __import__(package_name)
|
||||
package = __import__(package_name,
|
||||
fromlist=[package_name.split('.')[-1]])
|
||||
except ImportError:
|
||||
dep_error = True
|
||||
else:
|
||||
|
||||
@@ -143,14 +143,14 @@ def test_update_on_save():
|
||||
assert pic.modified
|
||||
assert pic.path is None
|
||||
|
||||
fd, filename = tempfile.mkstemp(suffix=".png")
|
||||
fd, filename = tempfile.mkstemp(suffix=".jpg")
|
||||
os.close(fd)
|
||||
try:
|
||||
pic.save(filename)
|
||||
|
||||
assert not pic.modified
|
||||
assert_equal(pic.path, os.path.abspath(filename))
|
||||
assert_equal(pic.format, "png")
|
||||
assert_equal(pic.format, "jpeg")
|
||||
finally:
|
||||
os.unlink(filename)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user