From a359a1244ae6e31911303da59c170ac61a91d09f Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 17 Sep 2025 16:38:31 +0100 Subject: [PATCH 1/3] fix(FIR-49285): remove incompatible method call for python 3.12 --- .github/workflows/code-check.yml | 4 ++-- .github/workflows/nightly-v1.yml | 2 +- .github/workflows/nightly-v2.yml | 2 +- .github/workflows/unit-tests.yml | 4 ++-- src/firebolt_db/firebolt_dialect.py | 18 +++++++++++++++++- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index eaaa5bc..a95f0f9 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -19,10 +19,10 @@ jobs: with: ref: ${{ inputs.branch }} - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | diff --git a/.github/workflows/nightly-v1.yml b/.github/workflows/nightly-v1.yml index 4504a1f..f35f8b6 100644 --- a/.github/workflows/nightly-v1.yml +++ b/.github/workflows/nightly-v1.yml @@ -22,7 +22,7 @@ jobs: max-parallel: 2 matrix: os: ['ubuntu-latest', 'macos-13', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/nightly-v2.yml b/.github/workflows/nightly-v2.yml index 4195b4b..2fd41c5 100644 --- a/.github/workflows/nightly-v2.yml +++ b/.github/workflows/nightly-v2.yml @@ -22,7 +22,7 @@ jobs: max-parallel: 2 matrix: os: ['ubuntu-latest', 'macos-13', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index cf4169d..e02db4a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -24,10 +24,10 @@ jobs: with: ref: ${{ inputs.branch }} - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | diff --git a/src/firebolt_db/firebolt_dialect.py b/src/firebolt_db/firebolt_dialect.py index fe0c918..f966cfa 100644 --- a/src/firebolt_db/firebolt_dialect.py +++ b/src/firebolt_db/firebolt_dialect.py @@ -1,5 +1,4 @@ import os -from distutils.util import strtobool from types import ModuleType from typing import Any, Dict, List, Optional, Tuple, Union @@ -83,6 +82,23 @@ def removesuffix(s: str, suffix: str) -> str: return result +def strtobool(val: str) -> int: + """Copy of deprecated distutils.util.strtobool + Convert a string representation of truth to true (1) or false (0). + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + """ + val = val.lower() + if val in ("y", "yes", "t", "true", "on", "1"): + return 1 + elif val in ("n", "no", "f", "false", "off", "0"): + return 0 + else: + raise ValueError("invalid truth value %r" % (val,)) + + DEFAULT_TYPE = TEXT From aab2a7675e90c2b898382b20c983427dad42a04e Mon Sep 17 00:00:00 2001 From: ptiurin Date: Wed, 17 Sep 2025 16:44:00 +0100 Subject: [PATCH 2/3] bump greenlet version --- setup.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 5b53cee..4f51f65 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,6 @@ classifiers = Operating System :: OS Independent Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -29,7 +28,7 @@ packages = find: install_requires = firebolt-sdk>=1.13.0 sqlalchemy>=1.0.0 -python_requires = >=3.8 +python_requires = >=3.9 package_dir = = src @@ -45,7 +44,7 @@ sqlalchemy.dialects = dev = allure-pytest==2.* devtools==0.7.0 - greenlet==2.0.2 + greenlet==3.2.4 mock==4.0.3 mypy==0.910 pre-commit==3.5.0 From 57b6cf4c576893a8894e30608d56c0f552f58c40 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 18 Sep 2025 09:29:51 +0100 Subject: [PATCH 3/3] comment --- src/firebolt_db/firebolt_dialect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/firebolt_db/firebolt_dialect.py b/src/firebolt_db/firebolt_dialect.py index f966cfa..f7a54bb 100644 --- a/src/firebolt_db/firebolt_dialect.py +++ b/src/firebolt_db/firebolt_dialect.py @@ -87,7 +87,8 @@ def strtobool(val: str) -> int: Convert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values - are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + are 'n', 'no', 'f', 'false', 'off', and '0'. Values are compared + case-insensitively. Raises ValueError if 'val' is anything else. """ val = val.lower()