-
Notifications
You must be signed in to change notification settings - Fork 120
SG-40996 prevent tk component autoupdate #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
SG-40996 prevent tk component autoupdate #1077
Conversation
…inimum_python_version not met - Added _check_minimum_python_version() method in base.py - Updated appstore.py get_latest_version() to check Python compatibility - If latest version requires newer Python, auto-update is blocked and current version is retained - Uses tank.util.version.is_version_newer_or_equal() for robust version comparison
… sg_matching_records for filtering, reduce nesting.
julien-lang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised to see so much new code in python/tank/descriptor/io_descriptor/appstore.py. We already have some code checking compatibility from app store components right? Like core min version, SG min version, ...
Could you write some tests too please? Like a test showing a component version is not selected because of the current Python version. But then running a higher Python version, the component get picked up
- 3 unit tests for _check_minimum_python_version validation - 2 end-to-end tests demonstrating version selection with cache fallback - Tests verify that incompatible versions are detected and older compatible versions are used when available
carlos-villavicencio-adsk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
julien-lang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a minor comment.
But also, should we document this new attribute in the Sphinx doc somewhere?
| import sys | ||
| import urllib.parse | ||
| import urllib.request | ||
| from typing import Dict, Iterator, List, Optional, Set, Tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a personal preference. But could you only import typing instead and then call typing.Dict, typing.Iterator, ...
Also t is before u. can we keep alpha order for dependencies?
Description
This pull request introduces Python version compatibility checks into the App Store descriptor logic, ensuring that bundles are only auto-updated to versions compatible with the current Python interpreter. It also adds utility methods for filtering and sorting cached versions and improves error handling and logging throughout the descriptor code.
Python version compatibility enforcement:
Added a
_check_minimum_python_versionmethod inIODescriptorBaseto compare the current Python version with the bundle'sminimum_python_versionrequirement from its manifest. This method is now used to block auto-updates to incompatible versions and to select the highest compatible cached version if the latest is not suitable. [1] [2]Updated
get_latest_versioninIODescriptorAppStoreto check Python compatibility before selecting the latest version, falling back to the newest compatible cached version if necessary, and logging appropriate warnings or info.Cached version selection and filtering:
IODescriptorAppStorefor filtering cached versions by label, App Store availability, and Python compatibility, and for sorting versions in descending order. These methods improve the robustness and maintainability of version selection logic.Imports and code cleanup:
io_descriptor/appstore.pyandio_descriptor/base.pyfor consistency and to support new functionality (e.g., importingsysandis_version_newer_or_equal). [1] [2]