diff --git a/README.md b/README.md index 000e37d84..5ae2c82ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![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 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/azure-pipelines.yml b/azure-pipelines.yml index 2d7c314ad..9bb53334d 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 diff --git a/docs/installation.rst b/docs/installation.rst index fe64d2844..8245b64de 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 19fd90115..621368e30 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 553097a75..98a93b5ba 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 afdd28437..d98e0cfe9 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 9b6a91a9d..bc7734b63 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 # Required 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.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 5c2074965..0a3ee1df5 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