Skip to content

many CI failures related to pkg_resources #11476

Closed

Description

@drammock

At first I thought it was just nilearn so I opened this: nilearn/nilearn#3512 but it's also happening with pybtex.

The meat of it is:

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

it happens on the line import pkg_resources. Here's a full traceback for the pybtex case:

Details
Traceback (most recent call last):
  File "/home/circleci/python_env/lib/python3.10/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/circleci/python_env/lib/python3.10/site-packages/sphinx/application.py", line 223, in __init__
    self.setup_extension(extension)
  File "/home/circleci/python_env/lib/python3.10/site-packages/sphinx/application.py", line 398, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/circleci/python_env/lib/python3.10/site-packages/sphinx/registry.py", line 459, in load_extension
    mod = import_module(extname)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/circleci/python_env/lib/python3.10/site-packages/sphinxcontrib/bibtex/__init__.py", line 9, in <module>
    from .domain import BibtexDomain
  File "/home/circleci/python_env/lib/python3.10/site-packages/sphinxcontrib/bibtex/domain.py", line 20, in <module>
    import pybtex_docutils
  File "/home/circleci/python_env/lib/python3.10/site-packages/pybtex_docutils/__init__.py", line 34, in <module>
    from pybtex.backends import BaseBackend
  File "/home/circleci/python_env/lib/python3.10/site-packages/pybtex/backends/__init__.py", line 26, in <module>
    from pybtex.plugin import Plugin
  File "/home/circleci/python_env/lib/python3.10/site-packages/pybtex/plugin/__init__.py", line 26, in <module>
    import pkg_resources
  File "/home/circleci/python_env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3257, in <module>
    def _initialize_master_working_set():
  File "/home/circleci/python_env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3231, in _call_aside
    f(*args, **kwargs)
  File "/home/circleci/python_env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3282, in _initialize_master_working_set
    tuple(dist.activate(replace=False) for dist in working_set)
  File "/home/circleci/python_env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3282, in <genexpr>
    tuple(dist.activate(replace=False) for dist in working_set)
  File "/home/circleci/python_env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2803, in activate
    declare_namespace(pkg)
  File "/home/circleci/python_env/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2297, in declare_namespace
    warnings.warn(msg, DeprecationWarning, stacklevel=2)
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

Activity

  1. cbrnr commented on Feb 14, 2023

    @cbrnr
    Contributor

    How difficult would it be to solve by removing pkg_resources? It should be easy for bcidata.

  2. drammock commented on Feb 14, 2023

    @drammock
    MemberAuthor

    It needs to be done in our dependencies. For the nilearn PR above it's a one-line fix. I've just opened https://bitbucket.org/pybtex-devs/pybtex/issues/169/replace-pkg_resources-with for pybtex. IDK how many other ones we'll hit though once those two are cleared up.

  3. cbrnr commented on Feb 14, 2023

    @cbrnr
    Contributor

    Ah OK! I thought we could also remove it in MNE, because maybe we can work around it (which is definitely possible in bcidata, but I don't know about the other occurrence).

  4. drammock commented on Feb 14, 2023

    @drammock
    MemberAuthor

    Ah OK! I thought we could also remove it in MNE

    We could catch / ignore the warnings but AFAICT this isn't something we can properly fix within our own codebase.

  5. larsoner commented on Feb 15, 2023

    @larsoner
    Member

    Workaround for us in #11478, thanks @drammock for doing the harder work of opening upstream bug reports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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