Finding packages inside zip files

#38 Merged at de3e886
Repository
takluyver
Branch
finder-zip-pkgs
Repository
anthony_tuininga
Branch
default
Author
  1. Thomas Kluyver
Reviewers
Description

This addresses issue #28, allowing packages to be found by zip files. There was already code to load modules from zip files, but it only worked for modules at the top level of the zip file, which is a fairly unusual case, and it didn't work on Python 3.

I'd hoped that it would be possible to use zipimport to load these modules, but there's some impedance mismatch between the PEP 302 APIs, which pass around fully qualified module names, and the imp style interfaces we use, which pass around a path and the last part of the module name. I didn't want to rewrite ModuleFinder to use the new APIs, so I've written the zip loader code for the imp API, but it ended up being more complex than I had expected.

I also added a simple test for the ZipModuleCache class I defined.

Comments (1)