aio-libs / aiosmtpd

A reimplementation of the Python stdlib smtpd.py based on asyncio.
https://aiosmtpd.aio-libs.org
Apache License 2.0
323 stars 96 forks source link

1.4.6: pytest fails because test suite uses deprecated `pkg_resources #461

Open kloczek opened 5 months ago

kloczek commented 5 months ago

Like it is in title ..

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiosmtpd-1.4.6-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiosmtpd-1.4.6-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
ImportError while loading conftest '/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.6/aiosmtpd/tests/conftest.py'.
aiosmtpd/tests/conftest.py:17: in <module>
    from pkg_resources import resource_filename
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:3292: in <module>
    def _initialize_master_working_set():
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:3266: in _call_aside
    f(*args, **kwargs)
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:3317: in _initialize_master_working_set
    tuple(dist.activate(replace=False) for dist in working_set)
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:3317: in <genexpr>
    tuple(dist.activate(replace=False) for dist in working_set)
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2832: in activate
    declare_namespace(pkg)
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2306: in declare_namespace
    warnings.warn(msg, DeprecationWarning, stacklevel=2)
E   DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
E   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
cuu508 commented 2 weeks ago

I got tests to run with

pytest -p no:warnings

This is a workaround, and should be fixed properly of course.