Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

build: fix presubmit #257

Merged
merged 3 commits into from
Nov 6, 2024
Merged

build: fix presubmit #257

merged 3 commits into from
Nov 6, 2024

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Oct 29, 2024

Fixes the error seen in #256 which occurred because opentelemetry was added as a direct dependency of google-cloud-pubsub and we run tests against pubsub via this code

def test(session, library, prerelease, protobuf_implementation):
"""Run tests from a downstream libraries.

==================================== ERRORS ====================================
____________________ ERROR collecting tests/unit/pubsub_v1 _____________________
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
:1381: in _gcd_import
    ???
:1354: in _find_and_load
    ???
:1325: in _find_and_load_unlocked
    ???
:929: in _load_unlocked
    ???
/tmpfs/src/github/python-api-common-protos/.nox/bd36180c/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:184: in exec_module
    exec(co, module.__dict__)
tests/unit/pubsub_v1/conftest.py:17: in 
    from opentelemetry.sdk.trace import TracerProvider
E   ModuleNotFoundError: No module named 'opentelemetry'
__________________ ERROR collecting tests/unit/test_pubsub.py __________________
ImportError while importing test module '/tmp/tmp765ev_kc/python-pubsub/tests/unit/test_pubsub.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/unit/test_pubsub.py:15: in 
    from google.cloud import pubsub
google/cloud/pubsub/__init__.py:20: in 
    from google.cloud.pubsub_v1 import PublisherClient
google/cloud/pubsub_v1/__init__.py:18: in 
    from google.cloud.pubsub_v1 import publisher
google/cloud/pubsub_v1/publisher/__init__.py:17: in 
    from google.cloud.pubsub_v1.publisher.client import Client
google/cloud/pubsub_v1/publisher/client.py:34: in 
    from google.cloud.pubsub_v1.publisher._batch import thread
google/cloud/pubsub_v1/publisher/_batch/thread.py:24: in 
    from opentelemetry import trace
E   ModuleNotFoundError: No module named 'opentelemetry'

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Oct 29, 2024
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 29, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 29, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: xs Pull request size is extra small. labels Oct 29, 2024
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. and removed size: m Pull request size is medium. labels Oct 29, 2024
@parthea parthea added the owlbot:ignore instruct owl-bot to ignore a PR label Oct 29, 2024
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 6, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 6, 2024
@parthea parthea marked this pull request as ready for review November 6, 2024 20:47
@parthea parthea requested a review from a team as a code owner November 6, 2024 20:47
if prerelease:
session.install("-e", f"{working_dir}/{downstream_dir}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move it outside the conditional logic like before and have a single session.install towards the end. It seems to be that we probably just want to remove install_command.extend(["--no-deps"])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The install_prerelease_dependencies has several install commands where we install pre-release versions of dependencies. I wanted to make sure to install the dependencies of the downstream client before upgrading to the pre-release versions of dependencies. If we did this at the end , we may downgrade the pre-release dependencies

@parthea parthea merged commit 654328e into main Nov 6, 2024
13 checks passed
@parthea parthea deleted the fix-build branch November 6, 2024 21:03
parthea added a commit to googleapis/python-grpc-google-iam-v1 that referenced this pull request Dec 23, 2024
parthea added a commit to googleapis/python-grpc-google-iam-v1 that referenced this pull request Dec 27, 2024
* chore(python): update dependencies in .kokoro/docker/docs

Source-Link: googleapis/synthtool@e808c98
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8e3e7e18255c22d1489258d0374c901c01f9c4fd77a12088670cd73d580aa737

* Add python 3.13 constraints file

* Add python 3.13 to setup.py

* Add python 3.13 to unittest.yml

* Add python 3.13 to noxfile

* Add flaky to test dependencies

* See googleapis/python-api-common-protos#257

* lint

* fix build

* fix build

* coverage

* coverage

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
owlbot:ignore instruct owl-bot to ignore a PR size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants