Skip to content
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
ghost opened this issue Feb 10, 2014 · 5 comments
Closed

Comments

@ghost
Copy link

ghost 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?


@ghost
Copy link
Author

ghost 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,
    }
)

@ghost
Copy link
Author

ghost 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?

@ghost
Copy link
Author

ghost 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.

@ghost
Copy link
Author

ghost commented Feb 12, 2014

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


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

@ghost
Copy link
Author

ghost commented Feb 12, 2014

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


Backed out changeset 28901bac2f2e See #148

@ghost ghost added major bug labels Mar 29, 2016
@ghost ghost closed this as completed Mar 29, 2016
jaraco added a commit that referenced this issue Jun 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants