-
-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support python2 in the setup.py rule. (#8956)
* Support python2 in the setup.py rule. - Detect the requested python version. - If python 2, only use __init__.py to determine packages (if python 3, any .py file denotes a package, per PEP 420). - Detect pkg_resources-style namespace package stanzas, and use them to populate the namespace_packages setup kwarg. Note that this change modifies some previous behavior that, after much diving into the innards of setuptools, was determined to be incorrect. Specifically: - Implicit namespace packages a la PEP 420 (and, for that matter, pkgutil-style namespace packages) are not supposed to be listed in the namespace_packages kwarg. - The empty string as a key in package_data means "include these resource patterns in all packages", rather than "here are resources at the root package", as we previously assumed There is in fact no principled way to load resources relative to the root package, so we omit those from package_data, and only enumerate resources that are under some named package. - resources() targets no longer define packages: the resource loading mechanism in pkg_resources will only load relative to an actual python module, so we now assign resources to their closest parent package, when computing package_data.
- Loading branch information
Showing
5 changed files
with
222 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.