Skip to content

Commit

Permalink
Switch to Python 3.12 in CI and release
Browse files Browse the repository at this point in the history
At-least flake8 needs to be updated to work with Python 3.12, see
PyCQA/flake8#1845.

We take this chance to upgrade others to the latest versions as well.

Newer flake8 flags some issues which are also fixed.
  • Loading branch information
hashhar committed Feb 16, 2024
1 parent 86a5150 commit 23eac30
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

env:
PYTHON_VERSION: "3.11"
PYTHON_VERSION: "3.12"

jobs:
release:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
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"
additional_dependencies:
- "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]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/sqlalchemy/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 23eac30

Please sign in to comment.