New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bb-migration opened this Issue Feb 10, 2014 · 5 comments

Comments

Projects
None yet
1 participant
@bb-migration

bb-migration commented Feb 10, 2014

Originally reported by: wyatt (Bitbucket: wyatt, GitHub: wyatt)


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?


@bb-migration

This comment has been minimized.

bb-migration commented Feb 10, 2014

Original comment by wyatt (Bitbucket: wyatt, GitHub: wyatt):


For now I'm using the following workaround:

#!python
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,
    }
)
@bb-migration

This comment has been minimized.

bb-migration commented Feb 10, 2014

Original comment by wyatt (Bitbucket: wyatt, GitHub: wyatt):


In answer to my own question, the reason is to support packages that use an ad hoc sort of namespacing scheme (see commit 28901ba). Does that use case still need to supported?

@bb-migration

This comment has been minimized.

bb-migration commented Feb 11, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


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.

@bb-migration

This comment has been minimized.

bb-migration commented Feb 12, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Merge backout of namespace package init module generation; ref #148.

@bb-migration

This comment has been minimized.

bb-migration commented Feb 12, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Backed out changeset 28901bac2f2e See #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment