Skip to content

Remove dead pkg_resources fallback for entry_points#2482

Open
junagent wants to merge 1 commit intovaexio:masterfrom
junagent:fix/remove-pkg-resources-fallback
Open

Remove dead pkg_resources fallback for entry_points#2482
junagent wants to merge 1 commit intovaexio:masterfrom
junagent:fix/remove-pkg-resources-fallback

Conversation

@junagent
Copy link
Copy Markdown

@junagent junagent commented Mar 20, 2026

Summary

Remove unreachable pkg_resources fallback code in packages/vaex-core/vaex/__init__.py - this is a dead code removal PR.

Problem

The code had a 3-level fallback for importing entry_points:

try:
    from sys import version_info
    if version_info[:2] >= (3, 10):
        from importlib.metadata import entry_points
    else:
        from importlib_metadata import entry_points
except ImportError:
    import pkg_resources
    entry_points = pkg_resources.iter_entry_points

The pkg_resources fallback (the except ImportError: block) is dead code:

  • Python 3.9+ (vaex minimum per numpy>=1.19.3,<3) always has importlib.metadata
  • importlib.metadata has been stdlib since Python 3.8
  • The except ImportError block is never reached

Fix

Replace the 9-line fallback block with a single import:

from importlib.metadata import entry_points

Testing

  • No functional change (dead code removal)
  • Reduces dependency on setuptools/pkg_resources

The pkg_resources fallback is unreachable since Python 3.9+
(vaex's minimum Python version) always has importlib.metadata.
Since importlib.metadata is in stdlib since Python 3.8,
the fallback is dead code.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant