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
Update or remove warning when namespace package doesn't use declare_namespace() #12
Comments
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): Good find. Yes, it does say that, but setuptools 0.7 is now meeting a different goal, and if there was code that removed the compatibility and warning, it's not part of this 0.7 release. I'll comb through the 'setuptools' branch (which was not merged and was originally slated for 0.7) and see if there's a corresponding changeset. Secondarily, we need to determine what's the proper thing to do about this warning and behavior. If it should be kept, it should be slated for setuptools 1.0 or later major increment release (per semantic versioning). I seem to think pkgutil.extend_path and pkg_resources.declare_namespace meet similar goals but from a different perspective. My hunch tells me that if the package is declared to be a namespace package (in the metadata), that's a setuptools feature and may be enforced by setuptools. I'll have to learn more. In the meantime, if anyone can shed some light on the issue, please feel free to do so. |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): I found the original changeset in the setuptools 0.7 branch: f3c5c1984206 I've since grafted that change to the master. This change will force a 3.0 release to signal backward incompatibility. @pje Are you aware of any issues with moving this intention forward other than the obvious backward incompatibility (which has long had a warning)? |
Original comment by pje (Bitbucket: pje, GitHub: pje): I don't see any issues with it, but to properly support PEP 420-style namespace packages (Python 3.3+), there are more changes needed. Notably, setuptools needs to be able to handle packages without an |
* Require toml extra for setuptools_scm setuptools_scm does not know to invoke itself if it can't read pyproject.toml. This broke sdist installs for projects deriving from skeleton: $ python -m pip install zipp --no-binary zipp Collecting zipp [...] Successfully installed zipp-0.0.0 Note the version number defaulting to '0.0.0'. Building locally only works because pep517, the build tool, depends on toml which it exposes to the build environment. * Require setuptools_scm 3.4.1 at a minimum A bare [tool.setuptools_scm] does not work in 3.4.0. * fixup! Require toml extra for setuptools_scm * fixup! Require setuptools_scm 3.4.1 at a minimum
Originally reported by: adrian (Bitbucket: adrian, GitHub: adrian)
When building a namespace package, Setuptools checks (by searching in the code) whether the
__init__.py
therein callsdeclare_namespace
frompkg_resources
. If it doesn't it, it logs a warning, emitted here, which reads:First of all, setuptools 0.7 now exists, so the future tense is somewhat worrisome. Also, I'm not sure whether requiring a
declare_namespace
call is actually in the plans anymore. (My package, for example, accomplishes namespace packages usingpkgutil.extend_path
from the standard library instead.) Some clarification, either in the warning or the docs, about what the plans are here would be helpful.The text was updated successfully, but these errors were encountered: