SG-36372 Switch distutil.version to packaging.version#105
Merged
Conversation
There was a problem hiding this comment.
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.LooseVersionwithpackaging.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]
eduardoChaucaGallegos
approved these changes
Aug 1, 2025
julien-lang
reviewed
Aug 6, 2025
julien-lang
reviewed
Aug 7, 2025
julien-lang
requested changes
Aug 25, 2025
julien-lang
approved these changes
Aug 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This component runs on FPTR desktop. In case of using the default desktop Python binary so it's safe to assume we have the
packagingmodule. Otherwise it can autodetect usingdistutils,packagingor 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.