Skip to content

Remove pkg_resources dependency from CLI metadata and plugin discovery #252

Description

@siddicky

Problem

The CLI imports pkg_resources at module load time for plugin discovery and version lookup. A clean uv-managed Python 3.14 tool environment installs only declared runtime dependencies, so the CLI fails before it can render help:

$ uv tool install --python 3.14 shodan
$ shodan --help
ModuleNotFoundError: No module named 'pkg_resources'

Declaring setuptools is not durable: current releases no longer provide pkg_resources, and pinning setuptools<81 only postpones removal.

Related work

This issue scopes a fully pkg_resources-free implementation so the CLI also works in isolated installers such as uv.

Proposed direction

  • Use stdlib importlib.metadata on Python 3.8+.
  • Use the official importlib-metadata backport on older supported Python versions.
  • Use the metadata API for both shodan.cli.plugins entry-point discovery and the shodan version command.
  • Add a regression test proving shodan.__main__ imports and --help renders when pkg_resources is unavailable.

I am preparing a focused PR with a clean uv/Python 3.14 reproduction and full test/build evidence.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions