Skip to content

fix: pin setuptools <81 to prevent pkg_resources removal - #36104

Merged
sadpandajoe merged 1 commit into
apache:masterfrom
aminghadersohi:amin/pkg-resources-deprecation-fix
Nov 17, 2025
Merged

sadpandajoe merged 1 commit into
apache:masterfrom
aminghadersohi:amin/pkg-resources-deprecation-fix

Conversation

@aminghadersohi

Copy link
Copy Markdown
Contributor

SUMMARY

Pin setuptools to version <81 to prevent breaking changes when pkg_resources is removed. The pkg_resources API is deprecated and scheduled for removal in setuptools 81+ (around 2025-11-30).

Problem:

  • pkg_resources deprecation warnings appearing in production logs (Datadog)
  • setuptools will remove pkg_resources API in version 81+
  • Some dependencies still use the deprecated API

Solution:

  • Add setuptools<81 constraint to requirements/base.in
  • This prevents runtime errors while dependencies migrate
  • Superset's codebase already uses the modern importlib.metadata API

Status:

  • ✅ Superset codebase: Already migrated to importlib.metadata (superset/db_engine_specs/init.py:36)
  • ⚠️ Third-party dependencies: Some still use pkg_resources (e.g., Preset's 'clients' package)
  • 📚 Documentation: Added migration guide at docs/docs/contributing/pkg-resources-migration.md

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A - Backend dependency management only

TESTING INSTRUCTIONS

  1. Verify setuptools version constraint:

    grep "setuptools" requirements/base.txt
    # Should show: setuptools==80.9.0 (or similar <81)
  2. Verify requirements regeneration:

    uv pip compile requirements/base.in -o /tmp/test-base.txt
    diff requirements/base.txt /tmp/test-base.txt
    # Should show no meaningful differences
  3. Check that Superset uses modern API:

    grep -r "from importlib.metadata import" superset/
    # Should find: superset/db_engine_specs/__init__.py:from importlib.metadata import entry_points
    
    grep -r "import pkg_resources" superset/
    # Should find: no results (good!)
  4. Review migration documentation:

    cat docs/docs/contributing/pkg-resources-migration.md

ADDITIONAL INFORMATION

  • Has associated issue: Fixes production Datadog warnings for pkg_resources deprecation
  • Required feature flags: None
  • Changes UI: No
  • Includes DB Migration: No
  • Introduces new feature or API: No
  • Removes existing feature or API: No

Timeline:

  • pkg_resources removal date: ~2025-11-30
  • This pin provides time for ecosystem migration
  • Can be removed once all dependencies update

References:

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label Nov 13, 2025

@korbit-ai korbit-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@bito-code-review

bito-code-review Bot commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #63fd84

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 6641076..6641076
    • requirements/base.in
    • requirements/base.txt
    • requirements/development.txt
  • Files skipped - 1
    • docs/docs/contributing/pkg-resources-migration.md - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the install:dependencies Installation - Dependencies label Nov 13, 2025
@codecov

codecov Bot commented Nov 13, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.37%. Comparing base (008c7c6) to head (cdc358e).
⚠️ Report is 847 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #36104       +/-   ##
===========================================
+ Coverage        0   68.37%   +68.37%     
===========================================
  Files           0      631      +631     
  Lines           0    45988    +45988     
  Branches        0     4987     +4987     
===========================================
+ Hits            0    31446    +31446     
- Misses          0    13295    +13295     
- Partials        0     1247     +1247     
Flag Coverage Δ
hive 43.95% <ø> (?)
mysql 67.46% <ø> (?)
postgres 67.51% <ø> (?)
presto 47.50% <ø> (?)
python 68.34% <ø> (?)
sqlite 67.12% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Pin setuptools to version <81 to prevent breaking changes when pkg_resources
is removed. The pkg_resources API is deprecated and scheduled for removal
in setuptools 81+ (around 2025-11-30).

While Superset's codebase has already migrated to importlib.metadata,
some production dependencies (notably Preset's 'clients' package) still
use pkg_resources. This pin provides time for all dependencies to migrate.

BREAKING CHANGE PREVENTION:
- Prevents runtime errors from pkg_resources removal
- Maintains compatibility with existing production deployments
- Allows gradual migration of dependent packages

WHAT'S INCLUDED:
- Added setuptools<81 constraint in requirements/base.in
- Regenerated base.txt and development.txt with minimal changes
- Created migration guide at docs/docs/contributing/pkg-resources-migration.md

SUPERSET STATUS:
- Superset codebase already uses importlib.metadata (superset/db_engine_specs/__init__.py:36)
- No changes needed to Superset code itself
- Only preventing breakage from third-party dependencies

MIGRATION PATH:
See docs/docs/contributing/pkg-resources-migration.md for:
- Timeline and affected packages
- Migration examples (pkg_resources → importlib.metadata)
- Action items for dependency updates
@sadpandajoe
sadpandajoe merged commit 519990e into apache:master Nov 17, 2025
sadpandajoe pushed a commit that referenced this pull request Dec 4, 2025
sadpandajoe pushed a commit that referenced this pull request Dec 4, 2025
Facyla pushed a commit to Facyla/superset-contrib that referenced this pull request Dec 16, 2025
sadpandajoe pushed a commit that referenced this pull request Dec 16, 2025
sadpandajoe pushed a commit that referenced this pull request Feb 11, 2026
@sadpandajoe sadpandajoe added the v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch label Feb 11, 2026
sadpandajoe pushed a commit that referenced this pull request Feb 11, 2026
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation install:dependencies Installation - Dependencies size/L v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants