Skip to content

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#591)
Browse files Browse the repository at this point in the history
* chore: update to gapic-generator-python 1.5.0

feat: add support for `google.cloud.<api>.__version__`
PiperOrigin-RevId: 484665853

Source-Link: googleapis/googleapis@8eb249a

Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* update version in gapic_version.py

* add .release-please-manifest.json with correct version

* set manifest to true in .github/release-please.yml

* add release-please-config.json

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Update to gapic-generator-python 1.6.0

feat(python): Add typing to proto.Message based class attributes

feat(python): Snippetgen handling of repeated enum field

PiperOrigin-RevId: 487326846

Source-Link: googleapis/googleapis@da380c7

Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: new APIs added to reflect updates to the filestore service

- Add ENTERPRISE Tier
- Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot
- Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare
- Add ConnectMode to NetworkConfig (for Private Service Access support)
- New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING)
- Add SuspensionReason (for KMS related suspension)
- Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled

PiperOrigin-RevId: 487492758

Source-Link: googleapis/googleapis@5be5981

Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* update path to snippet metadata json

* chore: Update gapic-generator-python to v1.6.1

PiperOrigin-RevId: 488036204

Source-Link: googleapis/googleapis@08f275f

Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: added cx_current_page field to AutomatedAgentReply
docs: clarified docs for Sentiment

PiperOrigin-RevId: 489494136

Source-Link: googleapis/googleapis@813e2fa

Source-Link: https://github.com/googleapis/googleapis-gen/commit/dcf495943f59026b392927c19c652f61bd1f9869
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGNmNDk1OTQzZjU5MDI2YjM5MjkyN2MxOWM2NTJmNjFiZDFmOTg2OSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: added cx_current_page field to AutomatedAgentReply
docs: clarified docs for Sentiment

PiperOrigin-RevId: 490103678

Source-Link: googleapis/googleapis@8f95a5f

Source-Link: https://github.com/googleapis/googleapis-gen/commit/fed1c108dbe9291c14f7f305ca1e8bf2830c9c60
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmVkMWMxMDhkYmU5MjkxYzE0ZjdmMzA1Y2ExZThiZjI4MzBjOWM2MCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* use templated owlbot.py and setup.py

* run nox format session

* fix(deps): Require google-api-core >=1.34.0, >=2.11.0

fix: Drop usage of pkg_resources

fix: Fix timeout default values

docs(samples): Snippetgen should call await on the operation coroutine before calling result

PiperOrigin-RevId: 493260409

Source-Link: googleapis/googleapis@fea4387

Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add gapic_version.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Dec 14, 2022
1 parent 5ef9172 commit 1e967a1
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 31 deletions.
10 changes: 5 additions & 5 deletions dialogflow/analyze_content_stream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import conversation_profile_management
import participant_management


PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
AUDIO_FILE_PATH = "{0}/resources/book_a_room.wav".format(
os.path.realpath(os.path.dirname(__file__)),
Expand All @@ -37,8 +36,7 @@ def conversation_profile_display_name():
def conversation_profile_id(conversation_profile_display_name):
# Create conversation profile.
response = conversation_profile_management.create_conversation_profile_article_faq(
project_id=PROJECT_ID,
display_name=conversation_profile_display_name
project_id=PROJECT_ID, display_name=conversation_profile_display_name
)
conversation_profile_id = response.name.split("conversationProfiles/")[1].rstrip()

Expand All @@ -61,7 +59,9 @@ def conversation_id(conversation_profile_id):
yield conversation_id

# Complete the conversation.
conversation_management.complete_conversation(project_id=PROJECT_ID, conversation_id=conversation_id)
conversation_management.complete_conversation(
project_id=PROJECT_ID, conversation_id=conversation_id
)


@pytest.fixture
Expand All @@ -79,7 +79,7 @@ def test_analyze_content_audio_stream(capsys, conversation_id, participant_id):
participant_management.analyze_content_audio_stream(
project_id=PROJECT_ID,
conversation_id=conversation_id,
participant_id=participant_id ,
participant_id=participant_id,
audio_file_path=AUDIO_FILE_PATH,
)
out, _ = capsys.readouterr()
Expand Down
3 changes: 1 addition & 2 deletions dialogflow/answer_record_management_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@


def test_smart_reply(capsys):
"""Test smart reply feature.
"""
"""Test smart reply feature."""

# Create conversation profile.
conversation_profile_management.create_conversation_profile_smart_reply(
Expand Down
5 changes: 4 additions & 1 deletion dialogflow/conversation_profile_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def create_conversation_profile_smart_reply(
}
feature_config = {
"suggestion_feature": {"type_": "SMART_REPLY"},
"suggestion_trigger_settings": {"no_small_talk": True, "only_end_user": True, },
"suggestion_trigger_settings": {
"no_small_talk": True,
"only_end_user": True,
},
"query_config": {
"document_query_source": {"documents": [smart_reply_allowlist_name]},
"max_results": 3,
Expand Down
1 change: 0 additions & 1 deletion dialogflow/create_document_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import uuid

from google.cloud import dialogflow_v2beta1 as dialogflow

import pytest

import document_management
Expand Down
4 changes: 3 additions & 1 deletion dialogflow/detect_intent_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def detect_intent_audio(project_id, session_id, audio_file_path, language_code):
query_input = dialogflow.QueryInput(audio_config=audio_config)

request = dialogflow.DetectIntentRequest(
session=session, query_input=query_input, input_audio=input_audio,
session=session,
query_input=query_input,
input_audio=input_audio,
)
response = session_client.detect_intent(request=request)

Expand Down
1 change: 0 additions & 1 deletion dialogflow/document_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

import argparse


KNOWLEDGE_TYPES = [
"KNOWLEDGE_TYPE_UNSPECIFIED",
"FAQ",
Expand Down
4 changes: 2 additions & 2 deletions dialogflow/list_training_phrases_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

import list_training_phrases


_, PROJECT_ID = google.auth.default()
INTENT_ID = "7b5bd47e-6dd9-4b45-8624-565862bd2d85"


def test_list_training_phrases(capsys):
training_phrases = list_training_phrases.list_training_phrases(
PROJECT_ID, INTENT_ID,
PROJECT_ID,
INTENT_ID,
)
assert len(training_phrases) >= 9 # Number of training phrases at this point.
16 changes: 8 additions & 8 deletions dialogflow/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import nox


# WARNING - WARNING - WARNING - WARNING - WARNING
# WARNING - WARNING - WARNING - WARNING - WARNING
# DO NOT EDIT THIS FILE EVER!
Expand Down Expand Up @@ -160,6 +159,7 @@ def blacken(session: nox.sessions.Session) -> None:
# format = isort + black
#


@nox.session
def format(session: nox.sessions.Session) -> None:
"""
Expand Down Expand Up @@ -187,7 +187,9 @@ def _session_tests(
session: nox.sessions.Session, post_install: Callable = None
) -> None:
# check for presence of tests
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob(
"**/test_*.py", recursive=True
)
test_list.extend(glob.glob("**/tests", recursive=True))

if len(test_list) == 0:
Expand All @@ -209,9 +211,7 @@ def _session_tests(

if os.path.exists("requirements-test.txt"):
if os.path.exists("constraints-test.txt"):
session.install(
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
)
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
else:
session.install("-r", "requirements-test.txt")
with open("requirements-test.txt") as rtfile:
Expand All @@ -224,9 +224,9 @@ def _session_tests(
post_install(session)

if "pytest-parallel" in packages:
concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto'])
concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"])
elif "pytest-xdist" in packages:
concurrent_args.extend(['-n', 'auto'])
concurrent_args.extend(["-n", "auto"])

session.run(
"pytest",
Expand Down Expand Up @@ -256,7 +256,7 @@ def py(session: nox.sessions.Session) -> None:


def _get_repo_root() -> Optional[str]:
""" Returns the root folder of the project. """
"""Returns the root folder of the project."""
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
p = Path(os.getcwd())
for i in range(10):
Expand Down
11 changes: 7 additions & 4 deletions dialogflow/participant_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def analyze_content_text(project_id, conversation_id, participant_id, text):
# [END dialogflow_analyze_content_text]

# [START dialogflow_analyze_content_audio_stream]
def analyze_content_audio_stream(project_id, conversation_id, participant_id, audio_file_path):
def analyze_content_audio_stream(
project_id, conversation_id, participant_id, audio_file_path
):
"""Analyze audio content for END_USER
Args:
Expand Down Expand Up @@ -156,12 +158,12 @@ def request_generator(audio_config, audio_file_path):

audio_config = dialogflow.InputAudioConfig(
audio_encoding=audio_encoding,
language_code='en-US',
language_code="en-US",
sample_rate_hertz=sample_rate_hertz,
single_utterance=True,
model='phone_call',
model="phone_call",
# Make sure your project is Dialogflow ES ENTERPRISE_TIER in order to "USE_ENHANCED" model.
model_variant='USE_ENHANCED'
model_variant="USE_ENHANCED",
)
requests = request_generator(audio_config, audio_file_path)
responses = client.streaming_analyze_content(requests=requests)
Expand All @@ -171,4 +173,5 @@ def request_generator(audio_config, audio_file_path):

print("=" * 20)


# [END dialogflow_analyze_content_audio_stream]
3 changes: 1 addition & 2 deletions dialogflow/participant_management_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@


def test_analyze_content_text(capsys):
"""Test analyze content api with text only messages.
"""
"""Test analyze content api with text only messages."""
# Create knowledge base.
knowledge_base_management.create_knowledge_base(
PROJECT_ID, KNOWLEDGE_BASE_DISPLAY_NAME
Expand Down
3 changes: 1 addition & 2 deletions dialogflow/set_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

# [START dialogflow_set_agent_sample]

from google.cloud.dialogflow_v2 import Agent
from google.cloud.dialogflow_v2 import AgentsClient
from google.cloud.dialogflow_v2 import Agent, AgentsClient


def set_agent(project_id, display_name):
Expand Down
1 change: 0 additions & 1 deletion dialogflow/set_agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os

from google.api_core.exceptions import InvalidArgument

import pytest

from set_agent import set_agent
Expand Down
1 change: 0 additions & 1 deletion dialogflow/update_intent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from google.cloud.dialogflow_v2.services.agents.client import AgentsClient
from google.cloud.dialogflow_v2.services.intents.client import IntentsClient
from google.cloud.dialogflow_v2.types.intent import Intent

import pytest

from update_intent import update_intent
Expand Down
1 change: 1 addition & 0 deletions dialogflow/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# TODO: change the default Entry Point text to handleWebhook


def handleWebhook(request):

req = request.get_json()
Expand Down

0 comments on commit 1e967a1

Please sign in to comment.