aminghadersohi opened a new pull request, #36104:
URL: https://github.com/apache/superset/pull/36104

   ### 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:
      ```bash
      grep "setuptools" requirements/base.txt
      # Should show: setuptools==80.9.0 (or similar <81)
      ```
   
   2. Verify requirements regeneration:
      ```bash
      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:
      ```bash
      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:
      ```bash
      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:**
   - [setuptools pkg_resources 
deprecation](https://setuptools.pypa.io/en/latest/pkg_resources.html)
   - [importlib.metadata 
documentation](https://docs.python.org/3/library/importlib.metadata.html)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to