Skip to content

zodburi import raises a warning with setuptools 67.3+ #31

Open
@azmeuk

Description

@azmeuk

setuptools has just been released: https://setuptools.pypa.io/en/latest/history.html#v67-3-0

On a clean virtualenv, install zodburi, setuptools==67.3.1 and pytest, and run a dummy test:

def test_foobar():
    import zodburi

This will raise this warning:

________________________________________________________ test_foobar _________________________________________________________

    def test_foobar():
>       import zodburi

test_foobar.py:2:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../.local/share/virtualenvs/test-sanl/lib/python3.10/site-packages/zodburi/__init__.py:2: in <module>
    from pkg_resources import iter_entry_points
../.local/share/virtualenvs/test-sanl/lib/python3.10/site-packages/pkg_resources/__init__.py:3257: in <module>
    def _initialize_master_working_set():
../.local/share/virtualenvs/test-sanl/lib/python3.10/site-packages/pkg_resources/__init__.py:3231: in _call_aside
    f(*args, **kwargs)
../.local/share/virtualenvs/test-sanl/lib/python3.10/site-packages/pkg_resources/__init__.py:3282: in _initialize_master_working_set
    tuple(dist.activate(replace=False) for dist in working_set)
../.local/share/virtualenvs/test-sanl/lib/python3.10/site-packages/pkg_resources/__init__.py:3282: in <genexpr>
    tuple(dist.activate(replace=False) for dist in working_set)
../.local/share/virtualenvs/test-sanl/lib/python3.10/site-packages/pkg_resources/__init__.py:2803: in activate
    declare_namespace(pkg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

packageName = 'zc'

    def declare_namespace(packageName):
        """Declare that package 'packageName' is a namespace package"""

        msg = (
            "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"
        )
>       warnings.warn(msg, DeprecationWarning, stacklevel=2)
E       DeprecationWarning: 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

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

The warning is not raised with setuptools 66

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions