Skip to content

Commit

Permalink
Merge pull request #2789 from jdufresne/olefile-optional
Browse files Browse the repository at this point in the history
Allow the olefile dependency to be optional
  • Loading branch information
wiredfool committed Nov 5, 2017
2 parents f5e4338 + 9175706 commit 533c5df
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Tests/test_file_fpx.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
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):

def test_invalid_file(self):
Expand Down
10 changes: 9 additions & 1 deletion Tests/test_file_mic.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
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"


@unittest.skipUnless(olefile_installed, "olefile package not installed")
class TestFileMic(PillowTestCase):

def test_sanity(self):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ docutils
jarn.viewdoc
nose-cov
nose
olefile
pep8
pyflakes
pyroma
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ def debug_build():
include_package_data=True,
packages=find_packages(),
scripts=glob.glob("Scripts/*.py"),
install_requires=['olefile'],
test_suite='nose.collector',
keywords=["Imaging", ],
license='Standard PIL License',
Expand All @@ -806,4 +805,3 @@ def debug_build():
""" % (str(err), str(err))
sys.stderr.write(msg)
raise DependencyException(msg)

0 comments on commit 533c5df

Please sign in to comment.