'return the Python package path by looking for the last
directory upwards which still contains an __init__.py.
Return None if a pkgpath can not be determined.'

def pypkgpath(self):

    pkgpath = None
    for parent in self.parts(reverse=True):
        if parent.isdir():
            if (not parent.join('__init__.py').exists()):
                break
            if (not isimportable(parent.basename)):
                break
            pkgpath = parent
    return pkgpath
