mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-06 12:53:12 +03:00
Merge pull request #2789 from jdufresne/olefile-optional
Allow the olefile dependency to be optional
This commit is contained in:
commit
533c5dfd05
|
@ -1,8 +1,14 @@
|
||||||
from helper import unittest, PillowTestCase
|
from helper import unittest, PillowTestCase
|
||||||
|
|
||||||
from PIL import FpxImagePlugin
|
try:
|
||||||
|
from PIL import FpxImagePlugin
|
||||||
|
except ImportError:
|
||||||
|
olefile_installed = False
|
||||||
|
else:
|
||||||
|
olefile_installed = True
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipUnless(olefile_installed, "olefile package not installed")
|
||||||
class TestFileFpx(PillowTestCase):
|
class TestFileFpx(PillowTestCase):
|
||||||
|
|
||||||
def test_invalid_file(self):
|
def test_invalid_file(self):
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
from helper import unittest, PillowTestCase, hopper
|
from helper import unittest, PillowTestCase, hopper
|
||||||
|
|
||||||
from PIL import Image, ImagePalette, MicImagePlugin
|
from PIL import Image, ImagePalette
|
||||||
|
|
||||||
|
try:
|
||||||
|
from PIL import MicImagePlugin
|
||||||
|
except ImportError:
|
||||||
|
olefile_installed = False
|
||||||
|
else:
|
||||||
|
olefile_installed = True
|
||||||
|
|
||||||
TEST_FILE = "Tests/images/hopper.mic"
|
TEST_FILE = "Tests/images/hopper.mic"
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipUnless(olefile_installed, "olefile package not installed")
|
||||||
class TestFileMic(PillowTestCase):
|
class TestFileMic(PillowTestCase):
|
||||||
|
|
||||||
def test_sanity(self):
|
def test_sanity(self):
|
||||||
|
|
|
@ -15,6 +15,7 @@ docutils
|
||||||
jarn.viewdoc
|
jarn.viewdoc
|
||||||
nose-cov
|
nose-cov
|
||||||
nose
|
nose
|
||||||
|
olefile
|
||||||
pep8
|
pep8
|
||||||
pyflakes
|
pyflakes
|
||||||
pyroma
|
pyroma
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -780,7 +780,6 @@ try:
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
scripts=glob.glob("Scripts/*.py"),
|
scripts=glob.glob("Scripts/*.py"),
|
||||||
install_requires=['olefile'],
|
|
||||||
test_suite='nose.collector',
|
test_suite='nose.collector',
|
||||||
keywords=["Imaging", ],
|
keywords=["Imaging", ],
|
||||||
license='Standard PIL License',
|
license='Standard PIL License',
|
||||||
|
@ -806,4 +805,3 @@ which was requested by the option flag --enable-%s
|
||||||
""" % (str(err), str(err))
|
""" % (str(err), str(err))
|
||||||
sys.stderr.write(msg)
|
sys.stderr.write(msg)
|
||||||
raise DependencyException(msg)
|
raise DependencyException(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user