1. PyPA
  2. Python Packaging Authority Projects
  3. setuptools
  4. Pull requests

Pull requests

#35 Declined
Repository
wyatt
Branch
default
Repository
pypa
Branch
default

Add support for PEP 420 namespace packages to find_packages()

Author
  1. Wyatt Baldwin
Reviewers
Description
No description

Comments (2)

  1. Wyatt Baldwin author

    A couple quirks of PEP 420 namespace packages (abbreviated "NS packages" below):

    • As implemented in Python 3.3, NS packages can be nested below regular packages.
    • More generally, if a directory is on sys.path, any subdirectory at any level can be imported as a NS package. There is no requirement that NS packages contain .py files or are empty.

    So the algorithm proposed here for detecting NS packages is technically incorrect.

    The potential issue is that if the contains .py files OR is empty constraints were removed, any package data directories would be included in the package list. The solution for that would be to add those (non)packages to the exclude list when calling find_packages().

    Conclusion: I think these constraints should be removed to make this implementation more consistent with how the import machinery works.

  2. Wyatt Baldwin author

    I was probably overly optimistic in submitting this PR. I'm going to create a new fork for working on PEP 420 stuff and add my changes on a branch.