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: 2 additions & 0 deletions packages/bigframes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
PYTEST_VERSION,
"pytest-cov",
"pytest-timeout",
"pluggy",
]
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
UNIT_TEST_DEPENDENCIES: List[str] = []
Expand Down Expand Up @@ -945,6 +946,7 @@ def core_deps_from_source(session, protobuf_implementation):
rather than pulling the dependencies from PyPI.
"""

# Trigger CI run for core_deps_from_source
# Install all dependencies
session.install("-e", ".")

Expand Down
44 changes: 40 additions & 4 deletions packages/db-dtypes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,49 @@ def docfx(session):


@nox.session(python=DEFAULT_PYTHON_VERSION)
def core_deps_from_source(session):
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
)
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source
rather than pulling the dependencies from PyPI.
"""
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
# Add core deps from source tests
session.skip("Core deps from source tests are not yet supported")
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
]

for dep in core_dependencies_from_source:
session.install(dep, "--no-deps", "--ignore-installed")
print(f"Installed {dep}")

tests_path = os.path.join("tests", "unit")
session.run(
"py.test",
"--quiet",
"-W default::FutureWarning",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=db_dtypes",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
tests_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
Expand Down
44 changes: 40 additions & 4 deletions packages/google-cloud-documentai-toolbox/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,43 @@ def mypy(session):


@nox.session(python=DEFAULT_PYTHON_VERSION)
def core_deps_from_source(session):
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
# Enable this test once this bug is fixed.
session.skip("Temporarily skip core_deps_from_source. See issue 16014")
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
)
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source"""
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
]

for dep in core_dependencies_from_source:
session.install(dep, "--no-deps", "--ignore-installed")
print(f"Installed {dep}")

tests_path = os.path.join("tests", "unit")
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=google",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
tests_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)
44 changes: 40 additions & 4 deletions packages/google-cloud-ndb/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,46 @@ def system_default(session):


@nox.session(python=DEFAULT_INTERPRETER)
def core_deps_from_source(session):
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
# Enable this test once this bug is fixed.
session.skip("Temporarily skip core_deps_from_source. See issue 16014")
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
)
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source"""
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
]

for dep in core_dependencies_from_source:
session.install(dep, "--no-deps", "--ignore-installed")
print(f"Installed {dep}")

tests_path = os.path.join("tests", "unit")
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=google",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
tests_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)


@nox.session(python=DEFAULT_INTERPRETER)
Expand Down
45 changes: 41 additions & 4 deletions packages/pandas-gbq/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,47 @@ def mypy(session):


@nox.session(python=DEFAULT_PYTHON_VERSION)
def core_deps_from_source(session):
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
)
@_calculate_duration
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source
rather than pulling the dependencies from PyPI.
"""
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
# Add core deps from source tests
session.skip("Core deps from source tests are not yet supported")
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
]

for dep in core_dependencies_from_source:
session.install(dep, "--no-deps", "--ignore-installed")
print(f"Installed {dep}")

tests_path = os.path.join("tests", "unit")
session.run(
"py.test",
"--quiet",
"-W default::PendingDeprecationWarning",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=pandas_gbq",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
tests_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)
51 changes: 47 additions & 4 deletions packages/sqlalchemy-bigquery/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,53 @@ def mypy(session):


@nox.session(python=DEFAULT_PYTHON_VERSION)
def core_deps_from_source(session):
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
)
@_calculate_duration
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source
rather than pulling the dependencies from PyPI.
"""
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
# Add core deps from source tests
session.skip("Core deps from source tests are not yet supported")
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

# Mimic unit session install target
if session.python in ["3.11", "3.12", "3.13", "3.14"]:
install_target = ".[geography,alembic,tests,bqstorage]"
else:
install_target = ".[all]"
session.install("-e", install_target, "-c", constraints_path)

core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
]

for dep in core_dependencies_from_source:
session.install(dep, "--no-deps", "--ignore-installed")
print(f"Installed {dep}")

tests_path = os.path.join("tests", "unit")
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=sqlalchemy_bigquery",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
tests_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)
37 changes: 35 additions & 2 deletions packages/sqlalchemy-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,42 @@ def mypy(session):


@nox.session(python=DEFAULT_PYTHON_VERSION)
def core_deps_from_source(session):
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
)
def core_deps_from_source(session, protobuf_implementation):
"""Run all tests with core dependencies installed from source"""
session.skip("Core deps from source tests are not yet supported")
session.install("setuptools")
session.install("pytest")
session.install("mock")
session.install(".")
session.install("opentelemetry-api")
session.install("opentelemetry-sdk")
session.install("opentelemetry-instrumentation")

core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
]

for dep in core_dependencies_from_source:
session.install(dep, "--no-deps", "--ignore-installed")
print(f"Installed {dep}")

tests_path = os.path.join("tests", "unit")
session.run(
"py.test",
"--quiet",
tests_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
Expand Down
Loading