Skip to content

fix: remove pkg_resources fallback for setuptools 82+ compatibility#1466

Open
junagent wants to merge 4 commits into
NVIDIA:masterfrom
junagent:fix/remove-pkg-resources-fallback
Open

fix: remove pkg_resources fallback for setuptools 82+ compatibility#1466
junagent wants to merge 4 commits into
NVIDIA:masterfrom
junagent:fix/remove-pkg-resources-fallback

Conversation

@junagent

Copy link
Copy Markdown

Summary

Remove deprecated pkg_resources fallback code for Python < 3.8 compatibility.

Root Cause

The code used a version check to conditionally import from importlib.metadata (Python 3.8+) or fall back to pkg_resources (removed in setuptools 82, PEP 740, Feb 2026):

if LooseVersion(sys.version) >= LooseVersion("3.8.0"):
    from importlib.metadata import version
    TRITON_CLIENT_VERSION = LooseVersion(version("tritonclient"))
else:
    import pkg_resources
    TRITON_CLIENT_VERSION = LooseVersion(pkg_resources.get_distribution("tritonclient").version)

The else branch using pkg_resources is dead code for Python 3.8+ and will fail on setuptools 82+.

Fix

Remove the else branch and use importlib.metadata.version() directly. Since Python 3.8 is the minimum supported version, the sys.version check is redundant.

Files Changed

  • triton/deployment_toolkit/triton_performance_runner/model_analyzer/runner.py
  • triton/deployment_toolkit/triton_performance_runner/perf_analyzer/runner.py
  • Tools/PyTorch/TimeSeriesPredictionPlatform/triton/run_performance_on_triton.py
  • PyTorch/Forecasting/TFT/triton/run_performance_on_triton.py

Fixes #ISSUE

@junagent

Copy link
Copy Markdown
Author

Bug label request for bounty tracking on Algora/IssueHunt. This PR removes deprecated pkg_resources fallback code for setuptools 82+ (PEP 740, Feb 2026) compatibility. The else branch using pkg_resources is dead code for Python 3.8+ and will fail on setuptools 82+.

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

Labels

None yet

1 participant