Issue #148 resolved

easy_install (via bdist_egg) adds __init__.py to PEP 420 namespace packages

Wyatt Baldwin
created an issue

https://bitbucket.org/pypa/setuptools/src/13a839bd8ad27a17543878068b996991357264d2/setuptools/command/bdist_egg.py?at=default#cl-273

This makes other packages in the namespace unimportable.

Proposed solutions:

  • Don't add a missing __init__.py under any circumstances
  • Or, if that's not feasible, don't add an __init__.py on Python 3.3+

It seems to me that the installer shouldn't be adding files to an installed package in any case. Is there a reason it does this?

Comments (9)

  1. Wyatt Baldwin reporter

    For now I'm using the following workaround:

    from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
    
    class bdist_egg(_bdist_egg):
    
        def make_init_files(self):
            return []
    
    setup(
        ...
        cmdclass={
            'bdist_egg': bdist_egg,
        }
    )
    
  2. Jason R. Coombs

    Thanks for highlighting this issue and doing the investigation.

    I don't believe that kluge should be supported any longer, particularly because it now comes into conflict with PEP-420 packages. It'll require a backward-incompatible release, but let's back out that support.

  3. Log in to comment