[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: BioPython: Some Python modules not found in tests at package build time



* Andreas Tille <andreas@an3as.eu>, 2014-04-28, 13:11:
[Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> in CC since it maintains python-reportlab]

ITYM s/maintains/is in Uploaders of/. It makes a big difference here...

Does this mean that not any member of the team could upload a fixed package?

I don't know that. What I know is that there were no commits to the package's repository by the maintainers since 2006. And changes by other team members made to the repository weren't integrated in package either.

Well, this was rather me forgetting a python-imaging dependency - I (wrongly) assumed that python-pil would be sufficient.

Note that python-imaging is only a compatibility package. It would be better to port biopython to the new PIL API.

Well, I have no idea what "porting" really means.

python-imaging's description more or less says what you have to change:
“PIL used to provide a PIL.pth file which allowed you to `import Image` but this is deprecated. Use `from PIL import Image` now, or install this compatibility package to temporarily get the old behavior back.”

If there might be a simple patch that would be OK. Otherwise I can only hope for upstream.

That attached (untested) patch should do the trick.

--
Jakub Wilk
diff --git a/Tests/test_GenomeDiagram.py b/Tests/test_GenomeDiagram.py
--- a/Tests/test_GenomeDiagram.py
+++ b/Tests/test_GenomeDiagram.py
@@ -27,7 +27,7 @@
             "Install reportlab if you want to use Bio.Graphics.")
 
 try:
-    import Image
+    from PIL import Image
     from reportlab.graphics import renderPM
 except ImportError:
     #This is an optional part of ReportLab, so may not be installed.
diff --git a/Tests/test_GraphicsBitmaps.py b/Tests/test_GraphicsBitmaps.py
--- a/Tests/test_GraphicsBitmaps.py
+++ b/Tests/test_GraphicsBitmaps.py
@@ -35,7 +35,7 @@
         "bitmaps with Bio.Graphics.")
 try:
     # Skip the test if PIL is not installed
-    import Image as i
+    from PIL import Image as i
     del i
 except:
     raise MissingPythonDependencyError(

Reply to: