Skip to content

Commit 6c0fe83

Browse files
Bump python-api to v3.9.1 (#1072)
1 parent ca9b5ae commit 6c0fe83

6 files changed

Lines changed: 441 additions & 284 deletions

File tree

python/tank_vendor/shotgun_api3/__init__.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,40 @@
88
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
99
# not expressly granted therein are reserved by Shotgun Software Inc.
1010

11+
import os
12+
import sys
13+
import warnings
14+
15+
if sys.version_info < (3, 7):
16+
if os.environ.get("SHOTGUN_ALLOW_OLD_PYTHON", "0") != "1":
17+
# This is our preferred default behavior when using an old
18+
# unsupported Python version.
19+
# This way, we can control where the exception is raised, and it provides a
20+
# comprehensive error message rather than having users facing a random
21+
# Python traceback and trying to understand this is due to using an
22+
# unsupported Python version.
23+
24+
raise RuntimeError("This module requires Python version 3.7 or higher.")
25+
26+
warnings.warn(
27+
"Python versions older than 3.7 are no longer supported as of January "
28+
"2023. Since the SHOTGUN_ALLOW_OLD_PYTHON variable is enabled, this "
29+
"module is raising a warning instead of an exception. "
30+
"However, it is very likely that this module will not be able to work "
31+
"on this Python version.",
32+
RuntimeWarning,
33+
stacklevel=2,
34+
)
35+
elif sys.version_info < (3, 9):
36+
warnings.warn(
37+
"Python versions older than 3.9 are no longer supported as of March "
38+
"2025 and compatibility will be discontinued after March 2026. "
39+
"Please update to Python 3.11 or any other supported version.",
40+
DeprecationWarning,
41+
stacklevel=2,
42+
)
43+
44+
1145
from .shotgun import (
1246
Shotgun,
1347
ShotgunError,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
09dd4cbd395fc1c8a67bdb99bf14111b296a1ab9
1+
24fa0e1d2354170b3e28d3370ba6e7e9df20b5d4

python/tank_vendor/shotgun_api3/lib/mockgun/mockgun.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"""
116116

117117
import datetime
118+
from typing import Any
118119

119120
from ... import ShotgunError
120121
from ...shotgun import _Config
@@ -580,7 +581,7 @@ def _get_new_row(self, entity_type):
580581
row[field] = default_value
581582
return row
582583

583-
def _compare(self, field_type, lval, operator, rval):
584+
def _compare(self, field_type: str, lval: Any, operator: str, rval: Any) -> bool:
584585
"""
585586
Compares a field using the operator and value provide by the filter.
586587
@@ -797,7 +798,7 @@ def _row_matches_filter(self, entity_type, row, sg_filter, retired_only):
797798

798799
return self._compare(field_type, lval, operator, rval)
799800

800-
def _rearrange_filters(self, filters):
801+
def _rearrange_filters(self, filters: list) -> None:
801802
"""
802803
Modifies the filter syntax to turn it into a list of three items regardless
803804
of the actual filter. Most of the filters are list of three elements, so this doesn't change much.

python/tank_vendor/shotgun_api3/lib/mockgun/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SchemaFactory(object):
4747
_schema_cache_path = None
4848

4949
@classmethod
50-
def get_schemas(cls, schema_path, schema_entity_path):
50+
def get_schemas(cls, schema_path: str, schema_entity_path: str) -> tuple:
5151
"""
5252
Retrieves the schemas from disk.
5353

python/tank_vendor/shotgun_api3/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)