From b8ce27d4e2b4599c7fafbc733c67d071ab508885 Mon Sep 17 00:00:00 2001 From: Ashhar Hasan Date: Fri, 16 Feb 2024 22:32:19 +0530 Subject: [PATCH] Switch to Python 3.12 in CI and release At-least flake8 needs to be updated to work with Python 3.12, see https://github.com/PyCQA/flake8/issues/1845. We take this chance to upgrade others to the latest versions as well. Newer flake8 flags some issues which are also fixed. --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 8 ++++---- setup.py | 4 ++-- tests/unit/sqlalchemy/conftest.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e03f2674..2b37f39c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: "Install Python" uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: "pip" cache-dependency-path: setup.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cd330b7..a7e791f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: env: - PYTHON_VERSION: "3.11" + PYTHON_VERSION: "3.12" jobs: release: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c2987ced..a781ab8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: "https://github.com/PyCQA/flake8" - rev: "5.0.4" + rev: "7.0.0" hooks: - id: "flake8" name: "Python: analysis" - repo: "https://github.com/pre-commit/mirrors-mypy" - rev: "v1.0.0" + rev: "v1.8.0" hooks: - id: "mypy" name: "Python: types" @@ -14,13 +14,13 @@ repos: - "types-all" - repo: https://github.com/pycqa/isort - rev: "5.12.0" + rev: "5.13.2" hooks: - id: isort args: [ "--profile", "black"] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.4.0" + rev: "v4.5.0" hooks: - id: check-yaml args: [--unsafe] diff --git a/setup.py b/setup.py index 53f79ef0..dae9f929 100755 --- a/setup.py +++ b/setup.py @@ -14,11 +14,11 @@ import os from codecs import open -from typing import Any +from typing import Any, Dict from setuptools import find_packages, setup -about = {} # type: dict[str, Any] +about: Dict[str, Any] = {} here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, "trino", "_version.py"), "r", "utf-8") as f: exec(f.read(), about) diff --git a/tests/unit/sqlalchemy/conftest.py b/tests/unit/sqlalchemy/conftest.py index 71d6f74d..64d893b2 100644 --- a/tests/unit/sqlalchemy/conftest.py +++ b/tests/unit/sqlalchemy/conftest.py @@ -23,7 +23,7 @@ def _assert_sqltype(this: SQLType, that: SQLType): if isinstance(that, type): that = that() - assert type(this) == type(that) + assert type(this) is type(that) if isinstance(this, ARRAY): _assert_sqltype(this.item_type, that.item_type)