Files
superset2/docs/developer_docs/contributing/pkg-resources-migration.md
Evan Rusackas 8ddb06bb2f docs: fix broken links, missing sidebar entries, and restore lost content
- Replace all /developer_portal/ links with /developer-docs/ in index.md
- Fix non-existent extension-project-structure references
- Fix sidebar links using old /docs/ paths (/user-docs/ instead)
- Add missing extension-points/editors and pkg-resources-migration to sidebar
- Restore Kubernetes debugging section lost during howtos migration
- Restore pkg-resources-migration.md deleted during bifurcation
- Fix versioned docs quickstart.mdx missing version prefix
- Update stale developer_portal references in README, DOCS_CLAUDE, intro.md
- Fix broken creating-viz-plugins link in intro.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:41:27 -08:00

2.8 KiB

title, sidebar_position
title sidebar_position
pkg_resources Migration Guide 9

pkg_resources Deprecation and Migration Guide

Background

As of setuptools 81.0.0, the pkg_resources API is deprecated and will be removed. This affects several packages in the Python ecosystem.

Current Status

Superset Codebase

The Superset codebase has already migrated away from pkg_resources to the modern importlib.metadata API:

  • superset/db_engine_specs/__init__.py - Uses from importlib.metadata import entry_points
  • All entry point loading uses the modern API

Production Dependencies

Some third-party dependencies may still use pkg_resources. Monitor your dependency tree for packages that haven't migrated yet.

Migration Path

Short-term Solution

Pin setuptools to version 80.x to prevent breaking changes:

# requirements/base.in
setuptools<81

This prevents the removal of pkg_resources while dependent packages are updated.

Long-term Solution

Update all dependencies to use importlib.metadata instead of pkg_resources:

Migration Example

Old (deprecated):

import pkg_resources

version = pkg_resources.get_distribution("package_name").version
entry_points = pkg_resources.iter_entry_points("group_name")

New (recommended):

from importlib.metadata import version, entry_points

pkg_version = version("package_name")
eps = entry_points(group="group_name")

Action Items

For Superset Maintainers

  1. The Superset codebase already uses importlib.metadata
  2. Monitor third-party dependencies for updates
  3. Update setuptools pin once the ecosystem is ready

For Extension Developers

  1. Update your packages to use importlib.metadata instead of pkg_resources
  2. Test with setuptools >= 81.0.0 once all packages are migrated

References