Skip to content

Commit a876468

Browse files
committed
Fix zope_interface and add python3 compatibility
The `zope.interface` module lacks of the __init__.py file in one of his folders, that leads into an ImportError: No module named zope.interface
1 parent 78645ea commit a876468

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pythonforandroid/recipes/zope_interface/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from pythonforandroid.recipe import PythonRecipe
22
from pythonforandroid.toolchain import current_directory
3+
from pythonforandroid.toolchain import shprint
4+
from os.path import join, exists
35
import sh
46

57

@@ -10,9 +12,19 @@ class ZopeInterfaceRecipe(PythonRecipe):
1012
url = 'https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz'
1113
site_packages_name = 'zope.interface'
1214

13-
depends = [('python2', 'python3crystax')]
1415
patches = ['no_tests.patch']
1516

17+
def build_arch(self, arch):
18+
super(ZopeInterfaceRecipe, self).build_arch(arch)
19+
# The zope.interface module lacks of the __init__.py file in one of his
20+
# folders, that leads into: ImportError: No module named zope.interface
21+
# Here we create the missing `init` file (this affects to version 4.1.3
22+
# (is this also true for latest versions of zope.interface?)
23+
zope_init_file = join(self.ctx.get_site_packages_dir(arch.arch),
24+
'zope', '__init__.py')
25+
if not exists(zope_init_file):
26+
shprint(sh.touch, zope_init_file)
27+
1628
def prebuild_arch(self, arch):
1729
super(ZopeInterfaceRecipe, self).prebuild_arch(arch)
1830
with current_directory(self.get_build_dir(arch.arch)):

0 commit comments

Comments
 (0)