Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: remove v1beta1 (#127)
v1beta1 API has been turned down.
  • Loading branch information
yoshi-automation committed Dec 22, 2020
1 parent b1b18ce commit dab2d53
Show file tree
Hide file tree
Showing 50 changed files with 201 additions and 3,471 deletions.
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
21 changes: 15 additions & 6 deletions CONTRIBUTING.rst
Expand Up @@ -21,8 +21,8 @@ In order to add a feature:
- The feature must be documented in both the API and narrative
documentation.
- The feature must work fully on the following CPython versions: 2.7,
3.5, 3.6, 3.7 and 3.8 on both UNIX and Windows.
- The feature must work fully on the following CPython versions:
3.6, 3.7, 3.8 and 3.9 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 @@ -111,6 +111,16 @@ Coding Style
should point to the official ``googleapis`` checkout and the
the branch should be the main branch on that remote (``master``).
- This repository contains configuration for the
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
our linters during a commit. If you have it installed on your ``$PATH``,
you can enable enforcing those checks via:
.. code-block:: bash
$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
Exceptions to PEP8:
- Many unit tests use a helper method, ``_call_fut`` ("FUT" is short for
Expand Down Expand Up @@ -192,25 +202,24 @@ Supported Python Versions
We support:
- `Python 3.5`_
- `Python 3.6`_
- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_
.. _Python 3.5: https://docs.python.org/3.5/
.. _Python 3.6: https://docs.python.org/3.6/
.. _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/
Supported versions can be found in our ``noxfile.py`` `config`_.
.. _config: https://github.com/googleapis/python-asset/blob/master/noxfile.py
Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.
We also explicitly decided to support Python 3 beginning with version
3.5. Reasons for this include:
3.6. Reasons for this include:
- Encouraging use of newest versions of Python 3
- Taking the lead of `prominent`_ open-source `projects`_
Expand Down
6 changes: 0 additions & 6 deletions docs/asset_v1beta1/services.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/asset_v1beta1/types.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/index.rst
Expand Up @@ -58,15 +58,6 @@ v1p5beta1
asset_v1p5beta1/types


v1beta1
~~~~~~~~~
.. toctree::
:maxdepth: 2

asset_v1beta1/services
asset_v1beta1/types


Migration Guide
---------------

Expand Down
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = AssetServiceGrpcTransport
_transport_registry["grpc_asyncio"] = AssetServiceGrpcAsyncIOTransport


__all__ = (
"AssetServiceTransport",
"AssetServiceGrpcTransport",
Expand Down
19 changes: 13 additions & 6 deletions google/cloud/asset_v1/services/asset_service/transports/grpc.py
Expand Up @@ -149,6 +149,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -167,9 +171,14 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
self._operations_client = None

# Run the base constructor.
super().__init__(
Expand All @@ -193,7 +202,7 @@ def create_channel(
) -> grpc.Channel:
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.
credentials (Optional[~.Credentials]): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
Expand Down Expand Up @@ -240,13 +249,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
client.
"""
# Sanity check: Only create a new client if we do not already have one.
if "operations_client" not in self.__dict__:
self.__dict__["operations_client"] = operations_v1.OperationsClient(
self.grpc_channel
)
if self._operations_client is None:
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)

# Return the client from cache.
return self.__dict__["operations_client"]
return self._operations_client

@property
def export_assets(
Expand Down
Expand Up @@ -194,6 +194,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -212,6 +216,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

# Run the base constructor.
Expand All @@ -225,6 +233,7 @@ def __init__(
)

self._stubs = {}
self._operations_client = None

@property
def grpc_channel(self) -> aio.Channel:
Expand All @@ -244,13 +253,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
client.
"""
# Sanity check: Only create a new client if we do not already have one.
if "operations_client" not in self.__dict__:
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
if self._operations_client is None:
self._operations_client = operations_v1.OperationsAsyncClient(
self.grpc_channel
)

# Return the client from cache.
return self.__dict__["operations_client"]
return self._operations_client

@property
def export_assets(
Expand Down
3 changes: 2 additions & 1 deletion google/cloud/asset_v1/types/__init__.py
Expand Up @@ -55,9 +55,9 @@
IamPolicyAnalysisOutputConfig,
AnalyzeIamPolicyLongrunningRequest,
AnalyzeIamPolicyLongrunningResponse,
ContentType,
)


__all__ = (
"TemporalAsset",
"TimeWindow",
Expand Down Expand Up @@ -96,4 +96,5 @@
"IamPolicyAnalysisOutputConfig",
"AnalyzeIamPolicyLongrunningRequest",
"AnalyzeIamPolicyLongrunningResponse",
"ContentType",
)
9 changes: 5 additions & 4 deletions google/cloud/asset_v1/types/asset_service.py
Expand Up @@ -424,10 +424,11 @@ class BigQueryDestination(proto.Message):
[partition_spec] determines whether to export to partitioned
table(s) and how to partition the data.
If [partition_spec] is unset or [partition_spec.partition_key]
is unset or ``PARTITION_KEY_UNSPECIFIED``, the snapshot
results will be exported to non-partitioned table(s).
[force] will decide whether to overwrite existing table(s).
If [partition_spec] is unset or
[partition_spec.partition_key] is unset or
``PARTITION_KEY_UNSPECIFIED``, the snapshot results will be
exported to non-partitioned table(s). [force] will decide
whether to overwrite existing table(s).
If [partition_spec] is specified. First, the snapshot
results will be written to partitioned table(s) with two
Expand Down
45 changes: 0 additions & 45 deletions google/cloud/asset_v1beta1/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions google/cloud/asset_v1beta1/py.typed

This file was deleted.

16 changes: 0 additions & 16 deletions google/cloud/asset_v1beta1/services/__init__.py

This file was deleted.

24 changes: 0 additions & 24 deletions google/cloud/asset_v1beta1/services/asset_service/__init__.py

This file was deleted.

0 comments on commit dab2d53

Please sign in to comment.