Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12", "3.13", "3.14"]
python: ['3.9', '3.10', "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
23 changes: 0 additions & 23 deletions packages/bigquery-magics/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,29 +177,6 @@ Build the docs via:

$ nox -s docs

*************************
Samples and code snippets
*************************

Code samples and snippets live in the `samples/` catalogue. Feel free to
provide more examples, but make sure to write tests for those examples.
Each folder containing example code requires its own `noxfile.py` script
which automates testing. If you decide to create a new folder, you can
base it on the `samples/snippets` folder (providing `noxfile.py` and
the requirements files).

The tests will run against a real Google Cloud Project, so you should
configure them just like the System Tests.

- To run sample tests, you can execute::

# Run all tests in a folder
$ cd samples/snippets
$ nox -s py-3.8

# Run a single sample test
$ cd samples/snippets
$ nox -s py-3.8 -- -k <name of test>

********************************************
Note About ``README`` as it pertains to PyPI
Expand Down
2 changes: 1 addition & 1 deletion packages/bigquery-magics/mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[mypy]
python_version = 3.8
python_version = 3.14
namespace_packages = True
64 changes: 7 additions & 57 deletions packages/bigquery-magics/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
DEFAULT_PYTHON_VERSION = "3.14"

UNIT_TEST_PYTHON_VERSIONS: List[str] = [
"3.8",
"3.9",
"3.10",
"3.11",
Expand All @@ -44,9 +43,6 @@
"3.14",
]

ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
ALL_PYTHON.extend(["3.7"])

UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
Expand Down Expand Up @@ -86,7 +82,7 @@
],
}

SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = UNIT_TEST_PYTHON_VERSIONS
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
Expand Down Expand Up @@ -225,36 +221,15 @@ def install_unittest_dependencies(session, *constraints):
session.install("-e", ".", *constraints)


@nox.session(python=ALL_PYTHON)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
)
def unit(session, protobuf_implementation):
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
def unit(session):
# 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",
"3.13",
"3.14",
):
session.skip("cpp implementation is not supported in python 3.11+")

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

# TODO(https://github.com/googleapis/synthtool/issues/1976):
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
# The 'cpp' implementation requires Protobuf<4.
if protobuf_implementation == "cpp":
session.install("protobuf<4")

# Run py.test against the unit tests.
session.run(
"py.test",
Expand All @@ -268,9 +243,6 @@ def unit(session, protobuf_implementation):
"--cov-fail-under=0",
os.path.join("tests", "unit"),
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)


Expand Down Expand Up @@ -444,21 +416,9 @@ def docfx(session):


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
)
def prerelease_deps(session, protobuf_implementation):
def prerelease_deps(session):
"""Run all tests with prerelease versions of dependencies installed."""

if protobuf_implementation == "cpp" and session.python in (
"3.11",
"3.12",
"3.13",
"3.14",
):
session.skip("cpp implementation is not supported in python 3.11+")

# Install all dependencies
session.install("-e", ".[all, tests, tracing]")
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
Expand Down Expand Up @@ -518,12 +478,11 @@ def prerelease_deps(session, protobuf_implementation):
# from main to detect any potential breaking changes. For context, see:
# https://github.com/googleapis/python-bigquery-pandas/issues/854
session.install(
"--pre",
"--upgrade",
"--ignore-installed",
# TODO(https://github.com/googleapis/google-cloud-python/pull/126): Install this again when we relax the pin.
# "https://github.com/cloudspannerecosystem/spanner-graph-notebook/archive/refs/heads/main.zip",
"https://github.com/googleapis/python-bigquery/archive/main.zip",
"https://github.com/googleapis/google-cloud-python/archive/main.zip#egg=google-cloud-bigquery-storage&subdirectory=packages/google-cloud-bigquery-storage",
f"{CURRENT_DIRECTORY}/../google-cloud-bigquery",
f"{CURRENT_DIRECTORY}/../google-cloud-bigquery-storage",
)
# Print out prerelease package versions
session.run("pip", "freeze")
Expand All @@ -536,9 +495,6 @@ def prerelease_deps(session, protobuf_implementation):
session.run(
"py.test",
"tests/unit",
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)

system_test_path = os.path.join("tests", "system.py")
Expand All @@ -558,9 +514,6 @@ def prerelease_deps(session, protobuf_implementation):
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)
if os.path.exists(system_test_folder_path):
session.run(
Expand All @@ -569,9 +522,6 @@ def prerelease_deps(session, protobuf_implementation):
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)


Expand Down
3 changes: 1 addition & 2 deletions packages/bigquery-magics/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
"License :: OSI Approved :: Apache Software 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",
Expand All @@ -120,7 +119,7 @@
packages=packages,
install_requires=dependencies,
extras_require=extras,
python_requires=">=3.8",
python_requires=">=3.9",
include_package_data=True,
zip_safe=False,
)
17 changes: 0 additions & 17 deletions packages/bigquery-magics/testing/constraints-3.8.txt

This file was deleted.

3 changes: 2 additions & 1 deletion packages/bigquery-magics/testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ google-cloud-bigquery-storage==2.6.0
ipywidgets==7.7.1
ipython==7.23.1
ipykernel==5.5.6
packaging=20.0.0
pandas==1.2.0
pyarrow==3.0.0
pydata-google-auth==1.5.0
tqdm==4.7.4
tqdm==4.7.4
31 changes: 2 additions & 29 deletions packages/db-dtypes/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
3.9, 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
Expand Down Expand Up @@ -177,29 +177,6 @@ Build the docs via:

$ nox -s docs

*************************
Samples and code snippets
*************************

Code samples and snippets live in the `samples/` catalogue. Feel free to
provide more examples, but make sure to write tests for those examples.
Each folder containing example code requires its own `noxfile.py` script
which automates testing. If you decide to create a new folder, you can
base it on the `samples/snippets` folder (providing `noxfile.py` and
the requirements files).

The tests will run against a real Google Cloud Project, so you should
configure them just like the System Tests.

- To run sample tests, you can execute::

# Run all tests in a folder
$ cd samples/snippets
$ nox -s py-3.8

# Run a single sample test
$ cd samples/snippets
$ nox -s py-3.8 -- -k <name of test>

********************************************
Note About ``README`` as it pertains to PyPI
Expand All @@ -221,17 +198,13 @@ Supported Python Versions

We support:

- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_
- `Python 3.14`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _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/
Expand All @@ -245,7 +218,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/db-dtypes/noxfile.py


We also explicitly decided to support Python 3 beginning with version 3.7.
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
Expand Down
11 changes: 1 addition & 10 deletions packages/db-dtypes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@
LINT_PYTHON_VERSION = "3.10"

UNIT_TEST_PYTHON_VERSIONS: List[str] = [
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
ALL_PYTHON.extend(["3.7"])

UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down Expand Up @@ -111,10 +108,6 @@ def lint(session):
session.run("flake8", "db_dtypes", "tests")


# TODO: the owlbot-python docker image still has python 3.8 installed (
# and only 3.8).
# As soon as that gets upgraded, we should be able to revert this session
# to using the DEFAULT_PYTHON_VERSION.
@nox.session(python=DEFAULT_PYTHON_VERSION)
def blacken(session):
"""Run black. Format code to uniform standard."""
Expand Down Expand Up @@ -285,12 +278,10 @@ def prerelease(session, tests_path):
)


@nox.session(python=ALL_PYTHON)
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
@nox.parametrize("test_type", ["unit", "compliance"])
def unit(session, test_type):
"""Run the unit test suite."""
if session.python == "3.7":
session.skip("Python 3.7 is no longer supported")

# Compliance tests only run on the latest Python version
if test_type == "compliance" and session.python != DEFAULT_PYTHON_VERSION:
Expand Down
3 changes: 1 addition & 2 deletions packages/db-dtypes/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def readme():
"License :: OSI Approved :: Apache Software 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",
Expand All @@ -76,6 +75,6 @@ def readme():
],
platforms="Posix; MacOS X; Windows",
install_requires=dependencies,
python_requires=">=3.8",
python_requires=">=3.9",
tests_require=["pytest"],
)
5 changes: 0 additions & 5 deletions packages/db-dtypes/testing/constraints-3.8.txt

This file was deleted.

11 changes: 11 additions & 0 deletions packages/db-dtypes/testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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",
# Then this file should have foo==1.14.0
numpy==1.24.0
packaging==24.2.0
pandas==1.5.3
pyarrow==13.0.0
4 changes: 1 addition & 3 deletions packages/google-auth-httplib2/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
DEFAULT_PYTHON_VERSION = "3.14"

UNIT_TEST_PYTHON_VERSIONS: List[str] = [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
Expand Down Expand Up @@ -481,7 +479,7 @@ def core_deps_from_source(session):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"google-auth @ git+https://github.com/googleapis/google-auth-library-python.git",
f"{CURRENT_DIRECTORY}/../google-auth",
]

for dep in core_dependencies_from_source:
Expand Down
Loading
Loading