Skip to content

SG-36372 Switch distutil.version to packaging.version#105

Merged
carlos-villavicencio-adsk merged 10 commits into
masterfrom
ticket/SG-36372_distutils
Sep 11, 2025
Merged

SG-36372 Switch distutil.version to packaging.version#105
carlos-villavicencio-adsk merged 10 commits into
masterfrom
ticket/SG-36372_distutils

Conversation

@carlos-villavicencio-adsk
Copy link
Copy Markdown
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk commented Jul 23, 2025

This component runs on FPTR desktop. In case of using the default desktop Python binary so it's safe to assume we have the packaging module. Otherwise it can autodetect using distutils, packaging or fall back to a simple string comparison. This is only for sorting the versions on the launcher.

We cannot use any of the available utils functions of tk-core, and we don't want to create a new coupling at this point.

@carlos-villavicencio-adsk carlos-villavicencio-adsk requested a review from a team July 23, 2025 20:52
@julien-lang julien-lang requested a review from Copilot July 28, 2025 16:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request modernizes version handling in the BaseLauncher class by replacing the deprecated distutils.version.LooseVersion with packaging.version.parse. The change removes conditional imports based on Python version and simplifies the version sorting implementation.

  • Replaces deprecated distutils.version.LooseVersion with packaging.version.parse
  • Consolidates imports and removes Python version-specific conditional logic
  • Restructures utility imports for better organization
Comments suppressed due to low confidence (1)

python/tk_multi_launchapp/base_launcher.py:508

  • [nitpick] The variable name 'v' is ambiguous in the list comprehension. Consider using a more descriptive name like 'version_str' to distinguish it from the 'version' module.
            sort_versions = [version.parse(v) for v in versions]

Comment thread python/tk_multi_launchapp/base_launcher.py Outdated
Comment thread python/tk_multi_launchapp/base_launcher.py Outdated
Comment thread python/tk_multi_launchapp/base_launcher.py Outdated
Comment thread python/tk_multi_launchapp/base_launcher.py Outdated
@carlos-villavicencio-adsk carlos-villavicencio-adsk merged commit 0150688 into master Sep 11, 2025
21 checks passed
@carlos-villavicencio-adsk carlos-villavicencio-adsk deleted the ticket/SG-36372_distutils branch September 11, 2025 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants