Silva Issue Tracker Archive: Issue1383

 This tracker has been migrated to Launchpad. Please post new messages at:
Title Remove PIL dependency from tests
Priority wish Status in-progress
Superseder (list) Nosy List faassen, kitblake, sacco (list)
Assigned To faassen Topics Silva-1.6, Zope2.7, images, zope2.8 (list)

Created on 2005-09-08.00:57:59 by sacco, last changed 2006-02-02.10:49:09 by faassen.

File nameUploadedTypeEdit Remove
24_ExtFile-tests.patch sacco, 2006-01-24.17:44:50 application/octet-stream
msg8407 (view) Author: faassen Date: 2006-02-02.10:49:09
Deferring this one for SIlva 1.5; will look into this again in Silva 1.6 era.
msg8257 (view) Author: sacco Date: 2006-01-24.17:44:49
As far as I recall, apart from the test which clemens fixed, the PIL dependency
was confined to the ExtFile tests.

If you want to remove this dependency, a dumb fix is simply to wrap everything
which depends on PIL in:
+        try:
+            from PIL import Image
+        except ImportError:
+            pass
+        else:
+            ...

or else (if there are several things together) to use:
+        try:
+            from PIL import Image
+            have_PIL = True
+        except ImportError:
+            have_PIL = False

+        if have_PIL:
+        else:
+           pass

For the sake of ... actually I'm not really sure why I did it ... I patched this
for ExtFile 1.4.4 (patch uploaded), but I did it rather fast so if anybody wants
to use it it might be worth checking that it looks sensible.
msg8116 (view) Author: faassen Date: 2006-01-18.13:04:33
Deferring this.
msg7740 (view) Author: sacco Date: 2005-09-09.07:29:59
I don't remember more than one test failing without  ExtFile  - I expect it's
the one for which you have the fix (although I think it failed in a slightly
different way if ExtFile was present).

However, the ExtFile tests gave me 26 Failures and 3 Errors with Silva but
without PIL, so it might be worth mentioning that if you want to install ExtFile
it's probably also a good idea to get PIL as well.
msg7734 (view) Author: clemens Date: 2005-09-08.22:27:37
I know which test is failing ... I just failed myself to check in the fix :-}

Beside of that, Silva should run fine without PIL.
Seemingly only a few people are running this w/o PIL.
[Maybe someone should setup a test zoo with lots of test installations
with various combinations of Zope versions / Extension products ...
hm, maybe should I do this ;-)]

What other tests are failing for You without ExtFile?
I do not have ExtFile installed, and the only test failing for me is
the test_manage_convertStorage (Silva.tests.test_fileservices.FileServicesTest)
msg7704 (view) Author: sacco Date: 2005-09-08.00:57:59
Somewhere (in the README, perhaps) it should be explained what (if anything)
will break if a site does not have PIL (Python Imaging Library) installed, as it
is not listed as a prerequisite and doesn't appear in INSTALL.txt, but seems to
be expected.

I think there is a least one test under Silva which gives an image error if PIL
is not present. (I seem to recall it also changes according to whether ExtFile
is present or not, but I can't remember details.)

Also, if both Silva and ExtFile are installed without having PIL there are a LOT
of test errors.  This should probably be mentioned togther with the description
of ExtFile.

Date User Action Args
2006-02-02 10:49:09faassensettopic: + Silva-1.6, - Silva-1.5
messages: + msg8407
2006-02-01 16:44:28faassensetstatus: deferred -> in-progress
2006-01-24 17:44:50saccosetfiles: + 24_ExtFile-tests.patch
messages: + msg8257
2006-01-24 17:05:11faassensettitle: PIL (Python Imaging Library) -> Remove PIL dependency from tests
2006-01-18 13:04:34faassensetstatus: chatting -> deferred
messages: + msg8116
2006-01-17 15:17:20faassensetnosy: + faassen
assignedto: faassen
2005-11-04 19:01:15thisfredsettopic: + Silva-1.5, - Silva-1.4
2005-09-29 12:01:17johnnysettopic: + Silva-1.4, - Silva-1.0, Silva-1.1, Silva-1.2, Silva-1.3
2005-09-15 11:30:19kitblakesetnosy: + kitblake
2005-09-09 07:29:59saccosetmessages: + msg7740
2005-09-08 22:27:38clemenssetstatus: unread -> chatting
messages: + msg7734
2005-09-08 00:58:00saccocreate