diff --git a/packages/sqlalchemy-bigquery/CONTRIBUTING.rst b/packages/sqlalchemy-bigquery/CONTRIBUTING.rst index 7e3bc4cd672d..7db9f22985ff 100644 --- a/packages/sqlalchemy-bigquery/CONTRIBUTING.rst +++ b/packages/sqlalchemy-bigquery/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. + 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -148,7 +148,7 @@ Running System Tests .. note:: - System tests are only configured to run under Python 3.9, 3.12, and 3.14. + System tests are only configured to run under Python 3.12 and 3.14. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -195,11 +195,11 @@ configure them just like the System Tests. # Run all tests in a folder $ cd samples/snippets - $ nox -s py-3.9 + $ nox -s py-3.10 # Run a single sample test $ cd samples/snippets - $ nox -s py-3.9 -- -k + $ nox -s py-3.10 -- -k ******************************************** Note About ``README`` as it pertains to PyPI @@ -221,14 +221,12 @@ Supported Python Versions We support: -- `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ - `Python 3.12`_ - `Python 3.13`_ - `Python 3.14`_ -.. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ .. _Python 3.12: https://docs.python.org/3.12/ @@ -241,17 +239,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_. .. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/sqlalchemy-bigquery/noxfile.py -We also explicitly decided to support Python 3 beginning with version 3.9. -Reasons for this include: - -- Encouraging use of newest versions of Python 3 -- Taking the lead of `prominent`_ open-source `projects`_ -- `Unicode literal support`_ which allows for a cleaner codebase that - works in both Python 2 and Python 3 - -.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django -.. _projects: http://flask.pocoo.org/docs/0.10/python3/ -.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/ ********** Versioning diff --git a/packages/sqlalchemy-bigquery/README.rst b/packages/sqlalchemy-bigquery/README.rst index be964f0c251c..0c31785fa9fe 100644 --- a/packages/sqlalchemy-bigquery/README.rst +++ b/packages/sqlalchemy-bigquery/README.rst @@ -51,11 +51,11 @@ dependencies. Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.9, <3.14 +Python >= 3.10, <= 3.14 Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python <= 3.7. +Python <= 3.9 Mac/Linux diff --git a/packages/sqlalchemy-bigquery/noxfile.py b/packages/sqlalchemy-bigquery/noxfile.py index 615ac0c30f5c..7e0bebd08159 100644 --- a/packages/sqlalchemy-bigquery/noxfile.py +++ b/packages/sqlalchemy-bigquery/noxfile.py @@ -44,8 +44,6 @@ DEFAULT_PYTHON_VERSION = "3.14" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ - "3.8", - "3.9", "3.10", "3.11", "3.12", @@ -53,7 +51,6 @@ "3.14", ] ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS) -ALL_PYTHON.extend(["3.7"]) UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -268,8 +265,6 @@ def install_unittest_dependencies(session, *constraints): def unit(session, protobuf_implementation, install_extras=True): # Install all test dependencies, then install this package in-place. - if session.python in ("3.7",): - session.skip("Python 3.7 is no longer supported") if protobuf_implementation == "cpp" and session.python in ( "3.11", "3.12", diff --git a/packages/sqlalchemy-bigquery/setup.py b/packages/sqlalchemy-bigquery/setup.py index bfe5b0299a91..8d7ad005c2ee 100644 --- a/packages/sqlalchemy-bigquery/setup.py +++ b/packages/sqlalchemy-bigquery/setup.py @@ -64,7 +64,7 @@ def readme(): "grpcio >= 1.47.0, < 2.0.0", "grpcio >= 1.49.1, < 2.0.0; python_version =='3.11'", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", - "pyarrow >= 5.0.0", + "pyarrow >= 6.0.0", ], } @@ -101,8 +101,6 @@ def readme(): "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -123,7 +121,7 @@ def readme(): "sqlalchemy>=1.4.16,<3.0.0", ], extras_require=extras, - python_requires=">=3.8, <3.15", + python_requires=">=3.10, <3.15", tests_require=["packaging", "pytz"], entry_points={ "sqlalchemy.dialects": ["bigquery = sqlalchemy_bigquery:BigQueryDialect"] diff --git a/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/__init__.py b/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/__init__.py index 762c7bba4b9a..7473f3326a46 100644 --- a/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/__init__.py +++ b/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/__init__.py @@ -22,7 +22,6 @@ import warnings -from . import _versions_helpers from ._types import ( ARRAY, BIGNUMERIC, @@ -44,16 +43,15 @@ ) from .base import BigQueryDialect, dialect from .version import __version__ +import sys -sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version() - -# Now that support for Python 3.7 and 3.8 has been removed, we don't expect the +# Now that support for Python 3.7, 3.8 and 3.9 has been removed, we don't expect the # following check to succeed. The warning is only included for robustness. -if sys_major == 3 and sys_minor in (7, 8): # pragma: NO COVER +if sys.version_info < (3, 10): # pragma: NO COVER warnings.warn( - "The python-bigquery-sqlalchemy library no longer supports Python 3.7 " - "and Python 3.8. " - f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We " + "The python-bigquery-sqlalchemy library no longer supports Python 3.7, " + "3.8 and 3.9. " + f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We " "recommend that you update soon to ensure ongoing support. For " "more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)", FutureWarning, diff --git a/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_versions_helpers.py b/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_versions_helpers.py deleted file mode 100644 index 37247c456d81..000000000000 --- a/packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_versions_helpers.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Shared helper functions for verifying versions of installed modules.""" - - -import sys -from typing import Tuple - - -def extract_runtime_version() -> Tuple[int, int, int]: - # Retrieve the version information - version_info = sys.version_info - - # Extract the major, minor, and micro components - major = version_info.major - minor = version_info.minor - micro = version_info.micro - - # Display the version number in a clear format - return major, minor, micro diff --git a/packages/sqlalchemy-bigquery/testing/constraints-3.10.txt b/packages/sqlalchemy-bigquery/testing/constraints-3.10.txt index e69de29bb2d1..31dd91a92cb5 100644 --- a/packages/sqlalchemy-bigquery/testing/constraints-3.10.txt +++ b/packages/sqlalchemy-bigquery/testing/constraints-3.10.txt @@ -0,0 +1,15 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", +sqlalchemy==1.4.16 +google-auth==2.14.1 +google-cloud-bigquery==3.20.0 +google-cloud-bigquery-storage==2.18.0 +google-api-core==2.11.1 +grpcio==1.47.0 +numpy==1.26.4 +alembic==1.7.7 +pyarrow==6.0.0 diff --git a/packages/sqlalchemy-bigquery/testing/constraints-3.8.txt b/packages/sqlalchemy-bigquery/testing/constraints-3.8.txt deleted file mode 100644 index 6138b6b82bf0..000000000000 --- a/packages/sqlalchemy-bigquery/testing/constraints-3.8.txt +++ /dev/null @@ -1,13 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List *all* library dependencies and extras in this file. -# Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -sqlalchemy==1.4.16 -google-auth==2.14.1 -google-cloud-bigquery==3.20.0 -google-cloud-bigquery-storage==2.18.0 -google-api-core==2.11.1 -grpcio==1.47.0 -numpy==1.24.4 diff --git a/packages/sqlalchemy-bigquery/testing/constraints-3.9.txt b/packages/sqlalchemy-bigquery/testing/constraints-3.9.txt deleted file mode 100644 index 574a7ffd4a55..000000000000 --- a/packages/sqlalchemy-bigquery/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List *all* library dependencies and extras in this file. -# Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -sqlalchemy==1.4.16 -google-auth==2.14.1 -google-cloud-bigquery==3.20.0 -google-cloud-bigquery-storage==2.18.0 -google-api-core==2.11.1 -grpcio==1.47.0 -numpy==1.26.4