zope.interface icon indicating copy to clipboard operation
zope.interface copied to clipboard

`pkg_resources.declare_namespace` is deprecated

Open bluetech opened this issue 1 year ago • 5 comments

BUG

What I did:

Imported zope.interface (through gevent).

What I expect to happen:

No warning.

What actually happened:

The method zope.interface uses to declare a namespace package is deprecated in latest setuptools:

DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

The relevant code:

https://github.com/zopefoundation/zope.interface/blob/405017fef489ff9d517d0e86e6cb0e6a14fb9bd6/src/zope/init.py

Linkified link:

https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

What version of Python and Zope/Addons I am using:

zope.interface==6.0

bluetech avatar Jun 05 '23 08:06 bluetech