Skip to content

Commit

Permalink
chore(python): add nox session to sort python imports (#305)
Browse files Browse the repository at this point in the history
* chore(python): add nox session to sort python imports

Source-Link: googleapis/synthtool@1b71c10
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416

* revert change to region tag

* 🦉 Updates from OwlBot post-processor

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Apr 21, 2022
1 parent c598360 commit 134e42e
Show file tree
Hide file tree
Showing 35 changed files with 280 additions and 172 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-language/.github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163
# created: 2022-04-06T10:30:21.687684602Z
digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416
# created: 2022-04-20T23:42:53.970438194Z
2 changes: 1 addition & 1 deletion packages/google-cloud-language/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
51 changes: 24 additions & 27 deletions packages/google-cloud-language/google/cloud/language/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,37 @@
# limitations under the License.
#

from google.cloud.language_v1.services.language_service.client import (
LanguageServiceClient,
)
from google.cloud.language_v1.services.language_service.async_client import (
LanguageServiceAsyncClient,
)

from google.cloud.language_v1.types.language_service import AnalyzeEntitiesRequest
from google.cloud.language_v1.types.language_service import AnalyzeEntitiesResponse
from google.cloud.language_v1.types.language_service import (
AnalyzeEntitySentimentRequest,
from google.cloud.language_v1.services.language_service.client import (
LanguageServiceClient,
)
from google.cloud.language_v1.types.language_service import (
AnalyzeEntitiesRequest,
AnalyzeEntitiesResponse,
AnalyzeEntitySentimentRequest,
AnalyzeEntitySentimentResponse,
AnalyzeSentimentRequest,
AnalyzeSentimentResponse,
AnalyzeSyntaxRequest,
AnalyzeSyntaxResponse,
AnnotateTextRequest,
AnnotateTextResponse,
ClassificationCategory,
ClassifyTextRequest,
ClassifyTextResponse,
DependencyEdge,
Document,
EncodingType,
Entity,
EntityMention,
PartOfSpeech,
Sentence,
Sentiment,
TextSpan,
Token,
)
from google.cloud.language_v1.types.language_service import AnalyzeSentimentRequest
from google.cloud.language_v1.types.language_service import AnalyzeSentimentResponse
from google.cloud.language_v1.types.language_service import AnalyzeSyntaxRequest
from google.cloud.language_v1.types.language_service import AnalyzeSyntaxResponse
from google.cloud.language_v1.types.language_service import AnnotateTextRequest
from google.cloud.language_v1.types.language_service import AnnotateTextResponse
from google.cloud.language_v1.types.language_service import ClassificationCategory
from google.cloud.language_v1.types.language_service import ClassifyTextRequest
from google.cloud.language_v1.types.language_service import ClassifyTextResponse
from google.cloud.language_v1.types.language_service import DependencyEdge
from google.cloud.language_v1.types.language_service import Document
from google.cloud.language_v1.types.language_service import Entity
from google.cloud.language_v1.types.language_service import EntityMention
from google.cloud.language_v1.types.language_service import PartOfSpeech
from google.cloud.language_v1.types.language_service import Sentence
from google.cloud.language_v1.types.language_service import Sentiment
from google.cloud.language_v1.types.language_service import TextSpan
from google.cloud.language_v1.types.language_service import Token
from google.cloud.language_v1.types.language_service import EncodingType

__all__ = (
"LanguageServiceClient",
Expand Down
52 changes: 26 additions & 26 deletions packages/google-cloud-language/google/cloud/language_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@
# limitations under the License.
#

from .services.language_service import LanguageServiceClient
from .services.language_service import LanguageServiceAsyncClient

from .types.language_service import AnalyzeEntitiesRequest
from .types.language_service import AnalyzeEntitiesResponse
from .types.language_service import AnalyzeEntitySentimentRequest
from .types.language_service import AnalyzeEntitySentimentResponse
from .types.language_service import AnalyzeSentimentRequest
from .types.language_service import AnalyzeSentimentResponse
from .types.language_service import AnalyzeSyntaxRequest
from .types.language_service import AnalyzeSyntaxResponse
from .types.language_service import AnnotateTextRequest
from .types.language_service import AnnotateTextResponse
from .types.language_service import ClassificationCategory
from .types.language_service import ClassifyTextRequest
from .types.language_service import ClassifyTextResponse
from .types.language_service import DependencyEdge
from .types.language_service import Document
from .types.language_service import Entity
from .types.language_service import EntityMention
from .types.language_service import PartOfSpeech
from .types.language_service import Sentence
from .types.language_service import Sentiment
from .types.language_service import TextSpan
from .types.language_service import Token
from .types.language_service import EncodingType
from .services.language_service import LanguageServiceAsyncClient, LanguageServiceClient
from .types.language_service import (
AnalyzeEntitiesRequest,
AnalyzeEntitiesResponse,
AnalyzeEntitySentimentRequest,
AnalyzeEntitySentimentResponse,
AnalyzeSentimentRequest,
AnalyzeSentimentResponse,
AnalyzeSyntaxRequest,
AnalyzeSyntaxResponse,
AnnotateTextRequest,
AnnotateTextResponse,
ClassificationCategory,
ClassifyTextRequest,
ClassifyTextResponse,
DependencyEdge,
Document,
EncodingType,
Entity,
EntityMention,
PartOfSpeech,
Sentence,
Sentiment,
TextSpan,
Token,
)

__all__ = (
"LanguageServiceAsyncClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .client import LanguageServiceClient
from .async_client import LanguageServiceAsyncClient
from .client import LanguageServiceClient

__all__ = (
"LanguageServiceClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,25 @@
import functools
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.cloud.language_v1.types import language_service
from .transports.base import LanguageServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import LanguageServiceGrpcAsyncIOTransport

from .client import LanguageServiceClient
from .transports.base import DEFAULT_CLIENT_INFO, LanguageServiceTransport
from .transports.grpc_asyncio import LanguageServiceGrpcAsyncIOTransport


class LanguageServiceAsyncClient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.cloud.language_v1.types import language_service
from .transports.base import LanguageServiceTransport, DEFAULT_CLIENT_INFO

from .transports.base import DEFAULT_CLIENT_INFO, LanguageServiceTransport
from .transports.grpc import LanguageServiceGrpcTransport
from .transports.grpc_asyncio import LanguageServiceGrpcAsyncIOTransport

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from .grpc import LanguageServiceGrpcTransport
from .grpc_asyncio import LanguageServiceGrpcAsyncIOTransport


# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[LanguageServiceTransport]]
_transport_registry["grpc"] = LanguageServiceGrpcTransport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import pkg_resources

import google.auth # type: ignore
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.language_v1.types import language_service

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
import warnings

from google.api_core import grpc_helpers
from google.api_core import gapic_v1
from google.api_core import gapic_v1, grpc_helpers
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

import grpc # type: ignore

from google.cloud.language_v1.types import language_service
from .base import LanguageServiceTransport, DEFAULT_CLIENT_INFO

from .base import DEFAULT_CLIENT_INFO, LanguageServiceTransport


class LanguageServiceGrpcTransport(LanguageServiceTransport):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
import warnings

from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.api_core import gapic_v1, grpc_helpers_async
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

import grpc # type: ignore
from grpc.experimental import aio # type: ignore

from google.cloud.language_v1.types import language_service
from .base import LanguageServiceTransport, DEFAULT_CLIENT_INFO

from .base import DEFAULT_CLIENT_INFO, LanguageServiceTransport
from .grpc import LanguageServiceGrpcTransport


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
ClassifyTextResponse,
DependencyEdge,
Document,
EncodingType,
Entity,
EntityMention,
PartOfSpeech,
Sentence,
Sentiment,
TextSpan,
Token,
EncodingType,
)

__all__ = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#
import proto # type: ignore


__protobuf__ = proto.module(
package="google.cloud.language.v1",
manifest={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@
# limitations under the License.
#

from .services.language_service import LanguageServiceClient
from .services.language_service import LanguageServiceAsyncClient

from .types.language_service import AnalyzeEntitiesRequest
from .types.language_service import AnalyzeEntitiesResponse
from .types.language_service import AnalyzeEntitySentimentRequest
from .types.language_service import AnalyzeEntitySentimentResponse
from .types.language_service import AnalyzeSentimentRequest
from .types.language_service import AnalyzeSentimentResponse
from .types.language_service import AnalyzeSyntaxRequest
from .types.language_service import AnalyzeSyntaxResponse
from .types.language_service import AnnotateTextRequest
from .types.language_service import AnnotateTextResponse
from .types.language_service import ClassificationCategory
from .types.language_service import ClassifyTextRequest
from .types.language_service import ClassifyTextResponse
from .types.language_service import DependencyEdge
from .types.language_service import Document
from .types.language_service import Entity
from .types.language_service import EntityMention
from .types.language_service import PartOfSpeech
from .types.language_service import Sentence
from .types.language_service import Sentiment
from .types.language_service import TextSpan
from .types.language_service import Token
from .types.language_service import EncodingType
from .services.language_service import LanguageServiceAsyncClient, LanguageServiceClient
from .types.language_service import (
AnalyzeEntitiesRequest,
AnalyzeEntitiesResponse,
AnalyzeEntitySentimentRequest,
AnalyzeEntitySentimentResponse,
AnalyzeSentimentRequest,
AnalyzeSentimentResponse,
AnalyzeSyntaxRequest,
AnalyzeSyntaxResponse,
AnnotateTextRequest,
AnnotateTextResponse,
ClassificationCategory,
ClassifyTextRequest,
ClassifyTextResponse,
DependencyEdge,
Document,
EncodingType,
Entity,
EntityMention,
PartOfSpeech,
Sentence,
Sentiment,
TextSpan,
Token,
)

__all__ = (
"LanguageServiceAsyncClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .client import LanguageServiceClient
from .async_client import LanguageServiceAsyncClient
from .client import LanguageServiceClient

__all__ = (
"LanguageServiceClient",
Expand Down
Loading

0 comments on commit 134e42e

Please sign in to comment.