From 6220a136695fa5050b9c4455d5d9e2721e9cfb69 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Mon, 5 Jan 2026 15:44:20 -0800 Subject: [PATCH 1/6] Add Python 3.13 CI tests --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2d7c314a..9bb53334 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -65,6 +65,7 @@ parameters: - '3.9' - '3.10' - '3.11' + - '3.13' - name: os_versions type: object From e2812f9d1858f132b8a17cd8c943fd41c324d272 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Tue, 6 Jan 2026 15:53:27 -0800 Subject: [PATCH 2/6] More changes for Python 3.13 --- README.md | 4 ++-- docs/installation.rst | 6 ++++-- setup.py | 1 + shotgun_api3/__init__.py | 2 +- shotgun_api3/lib/README.md | 2 +- shotgun_api3/shotgun.py | 23 ++++------------------- tests/ci_requirements.txt | 3 --- 7 files changed, 13 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 000e37d8..9aabe97f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Supported VFX Platform: 2022 - 2025](https://img.shields.io/badge/VFX_Platform-2022_|_2023_|_2024_|_2025-blue)](http://www.vfxplatform.com/ "Supported VFX Platform") -[![Supported Python versions: 3.9 - 3.11](https://img.shields.io/badge/Python-3.9_|_3.10_|_3.11-blue?logo=python&logoColor=f5f5f5)](https://www.python.org/ "Supported Python versions") +[![Supported VFX Platform: CY2022 - CY2026](https://img.shields.io/badge/VFX_Refererence_Platform-CY2022_|_CY2023_|_CY2024_|_CY2025_|_CY2026-blue)](http://www.vfxplatform.com/ "Supported VFX Reference Platform versions") +[![Supported Python versions: 3.9, 3.10, 3.11, 3.13](https://img.shields.io/badge/Python-3.9_|_3.10_|_3.11_|_3.13-blue?logo=python&logoColor=f5f5f5)](https://www.python.org/ "Supported Python versions") [![Reference Documentation](http://img.shields.io/badge/Reference-documentation-blue.svg?logo=wikibooks&logoColor=f5f5f5)](http://developer.shotgridsoftware.com/python-api) [![Build Status](https://dev.azure.com/shotgun-ecosystem/Python%20API/_apis/build/status/shotgunsoftware.python-api?branchName=master)](https://dev.azure.com/shotgun-ecosystem/Python%20API/_build/latest?definitionId=108&branchName=master) diff --git a/docs/installation.rst b/docs/installation.rst index fe64d284..8245b64d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -16,7 +16,9 @@ Minimum Requirements Python versions =============== -The Python API library supports the following Python versions: `3.9 - 3.11`. We recommend using Python 3.11. +The Python API library supports the following Python versions: `3.9`, `3.10`, +`3.11`, and `3.13`. +We recommend using Python 3.13. .. important:: Python versions older than 3.9 are no longer supported as of March 2025 and compatibility will be discontinued after @@ -68,4 +70,4 @@ If you're using pip with `requirements.txt`, add the following line:: Installing with ``setup.py`` **************************** -From a local copy of the repository, you can run ``python setup.py install`` to copy the package inside your python ``site-packages``. Note that while ``setuptools`` will complain about syntax errors when installing the library, the library is fully functional. However, it ships with both Python 2 and Python 3 copies of ``httplib2``, which will generate syntax errors when byte-compiling the Python modules. +From a local copy of the repository, you can run ``python setup.py install`` to copy the package inside your python ``site-packages``. Note that while ``setuptools`` will complain about syntax errors when installing the library, the library is fully functional. diff --git a/setup.py b/setup.py index 19fd9011..621368e3 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", ], ) diff --git a/shotgun_api3/__init__.py b/shotgun_api3/__init__.py index 553097a7..98a93b5b 100644 --- a/shotgun_api3/__init__.py +++ b/shotgun_api3/__init__.py @@ -36,7 +36,7 @@ warnings.warn( "Python versions older than 3.9 are no longer supported as of March " "2025 and compatibility will be discontinued after March 2026. " - "Please update to Python 3.11 or any other supported version.", + "Please update to Python 3.13 or any other supported version.", DeprecationWarning, stacklevel=2, ) diff --git a/shotgun_api3/lib/README.md b/shotgun_api3/lib/README.md index afdd2843..d98e0cfe 100644 --- a/shotgun_api3/lib/README.md +++ b/shotgun_api3/lib/README.md @@ -6,7 +6,7 @@ Some third-party modules are bundled with `python-api` inside lib. ### httplib2 -`httplib2` is used to make http connections to the Flow Production Tracking server. We bundle both python2 and python3 compatible versions since httplib2 chose to maintain parallel versions of the module for python 2 and 3 compatibility. +`httplib2` is used to make http connections to the Flow Production Tracking server. The version of `httplib2` bundled should be updated manually, however its version is included in the unused `shotgun_api3/lib/requirements.txt` to allow Github's automated CVE notifications to work. diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index 9b6a91a9..ada53dc7 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -from __future__ import annotations # Requried for 3.7 +from __future__ import annotations # Requried for compatibility with Python 3.7 import base64 import copy @@ -3162,29 +3162,17 @@ def authenticate_human_user( self.config.auth_token = auth_token try: - data = self.find_one( + return self.find_one( "HumanUser", [["sg_status_list", "is", "act"], ["login", "is", user_login]], ["id", "login"], "", "all", ) - # Set back to default - There finally and except cannot be used together in python2.4 - self.config.user_login = original_login - self.config.user_password = original_password - self.config.auth_token = original_auth_token - return data - except Fault: - # Set back to default - There finally and except cannot be used together in python2.4 - self.config.user_login = original_login - self.config.user_password = original_password - self.config.auth_token = original_auth_token - except Exception: - # Set back to default - There finally and except cannot be used together in python2.4 + finally: self.config.user_login = original_login self.config.user_password = original_password self.config.auth_token = original_auth_token - raise def update_project_last_accessed( self, project: Dict[str, Any], user: Optional[Dict[str, Any]] = None @@ -4191,10 +4179,7 @@ def _inbound_visitor(value): if isinstance(value, str): if len(value) == 20 and self._DATE_TIME_PATTERN.match(value): try: - # strptime was not on datetime in python2.4 - value = datetime.datetime( - *time.strptime(value, "%Y-%m-%dT%H:%M:%SZ")[:6] - ) + value = datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ") except ValueError: return value if _change_tz: diff --git a/tests/ci_requirements.txt b/tests/ci_requirements.txt index 5c207496..0a3ee1df 100644 --- a/tests/ci_requirements.txt +++ b/tests/ci_requirements.txt @@ -10,9 +10,6 @@ coverage coveralls==1.1 -# Don't restrict flake8 version, since we install this in CI against Python 2.6, -# where flake8 has discontinued support for newer releases. On Python 2.7 and -# Python 3.7, linting has been performed with flake8 3.7.8 flake8 nose==1.3.7 nose-exclude==0.5.0 From 59f586dc8668aec47be1d7919d5f9f7338e9b3d9 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Tue, 6 Jan 2026 16:02:48 -0800 Subject: [PATCH 3/6] fixup! More changes for Python 3.13 --- shotgun_api3/shotgun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index ada53dc7..5e38fb97 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -4179,7 +4179,7 @@ def _inbound_visitor(value): if isinstance(value, str): if len(value) == 20 and self._DATE_TIME_PATTERN.match(value): try: - value = datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ") + value = datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ") except ValueError: return value if _change_tz: From f331a46e6ca4b9f733a1e2eb0b5fde80e40a4800 Mon Sep 17 00:00:00 2001 From: Julien Langlois <16244608+julien-lang@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:28:19 -0800 Subject: [PATCH 4/6] Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9aabe97f..3aed3ca2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Supported VFX Platform: CY2022 - CY2026](https://img.shields.io/badge/VFX_Refererence_Platform-CY2022_|_CY2023_|_CY2024_|_CY2025_|_CY2026-blue)](http://www.vfxplatform.com/ "Supported VFX Reference Platform versions") +[![Supported VFX Platform: CY2022 - CY2026](https://img.shields.io/badge/VFX_Reference_Platform-CY2022_|_CY2023_|_CY2024_|_CY2025_|_CY2026-blue)](http://www.vfxplatform.com/ "Supported VFX Reference Platform versions") [![Supported Python versions: 3.9, 3.10, 3.11, 3.13](https://img.shields.io/badge/Python-3.9_|_3.10_|_3.11_|_3.13-blue?logo=python&logoColor=f5f5f5)](https://www.python.org/ "Supported Python versions") [![Reference Documentation](http://img.shields.io/badge/Reference-documentation-blue.svg?logo=wikibooks&logoColor=f5f5f5)](http://developer.shotgridsoftware.com/python-api) From c851ad105e7f7bf28bc4999c986f204510442374 Mon Sep 17 00:00:00 2001 From: Julien Langlois <16244608+julien-lang@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:28:29 -0800 Subject: [PATCH 5/6] Update shotgun_api3/shotgun.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- shotgun_api3/shotgun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index 5e38fb97..bc7734b6 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -from __future__ import annotations # Requried for compatibility with Python 3.7 +from __future__ import annotations # Required for compatibility with Python 3.7 import base64 import copy From 9458fc9022bdb657ca79795a6812c89f706089f8 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Wed, 7 Jan 2026 14:18:10 -0800 Subject: [PATCH 6/6] Remove VFX badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 3aed3ca2..5ae2c82f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Supported VFX Platform: CY2022 - CY2026](https://img.shields.io/badge/VFX_Reference_Platform-CY2022_|_CY2023_|_CY2024_|_CY2025_|_CY2026-blue)](http://www.vfxplatform.com/ "Supported VFX Reference Platform versions") [![Supported Python versions: 3.9, 3.10, 3.11, 3.13](https://img.shields.io/badge/Python-3.9_|_3.10_|_3.11_|_3.13-blue?logo=python&logoColor=f5f5f5)](https://www.python.org/ "Supported Python versions") [![Reference Documentation](http://img.shields.io/badge/Reference-documentation-blue.svg?logo=wikibooks&logoColor=f5f5f5)](http://developer.shotgridsoftware.com/python-api)