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/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 diff --git a/src/firebolt_db/firebolt_dialect.py b/src/firebolt_db/firebolt_dialect.py index fe0c918..f7a54bb 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,24 @@ 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'. Values are compared + case-insensitively. 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