diff --git a/.coveragerc b/.coveragerc index dd39c8546..0d8e6297d 100644 --- a/.coveragerc +++ b/.coveragerc @@ -17,6 +17,8 @@ # Generated by synthtool. DO NOT EDIT! [run] branch = True +omit = + google/cloud/__init__.py [report] fail_under = 100 @@ -32,4 +34,5 @@ omit = */gapic/*.py */proto/*.py */core/*.py - */site-packages/*.py \ No newline at end of file + */site-packages/*.py + google/cloud/__init__.py diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 000000000..97245042d --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,46 @@ +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: true + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - 'Kokoro' + - 'cla/google' +# List of explicit permissions to add (additive only) +permissionRules: + # Team slug to add to repository permissions + - team: yoshi-admins + # Access level required, one of push|pull|admin|maintain|triage + permission: admin + # Team slug to add to repository permissions + - team: yoshi-python-admins + # Access level required, one of push|pull|admin|maintain|triage + permission: admin + # Team slug to add to repository permissions + - team: yoshi-python + # Access level required, one of push|pull|admin|maintain|triage + permission: push diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c269cfd6..f46bcc42f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-bigtable/#history +### [1.5.1](https://www.github.com/googleapis/python-bigtable/compare/v1.5.0...v1.5.1) (2020-10-06) + + +### Bug Fixes + +* harden version data gathering against DistributionNotFound ([#150](https://www.github.com/googleapis/python-bigtable/issues/150)) ([c815421](https://www.github.com/googleapis/python-bigtable/commit/c815421422f1c845983e174651a5292767cfe2e7)) + ## [1.5.0](https://www.github.com/googleapis/python-bigtable/compare/v1.4.0...v1.5.0) (2020-09-22) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5d9a099ac..6d9432272 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -80,25 +80,6 @@ We use `nox `__ to instrument our tests. .. nox: https://pypi.org/project/nox/ -Note on Editable Installs / Develop Mode -======================================== - -- As mentioned previously, using ``setuptools`` in `develop mode`_ - or a ``pip`` `editable install`_ is not possible with this - library. This is because this library uses `namespace packages`_. - For context see `Issue #2316`_ and the relevant `PyPA issue`_. - - Since ``editable`` / ``develop`` mode can't be used, packages - need to be installed directly. Hence your changes to the source - tree don't get incorporated into the **already installed** - package. - -.. _namespace packages: https://www.python.org/dev/peps/pep-0420/ -.. _Issue #2316: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2316 -.. _PyPA issue: https://github.com/pypa/packaging-problems/issues/12 -.. _develop mode: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode -.. _editable install: https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs - ***************************************** I'm getting weird errors... Can you help? ***************************************** diff --git a/google/cloud/bigtable/__init__.py b/google/cloud/bigtable/__init__.py index 75b765a8a..f2c5a24bd 100644 --- a/google/cloud/bigtable/__init__.py +++ b/google/cloud/bigtable/__init__.py @@ -15,9 +15,13 @@ """Google Cloud Bigtable API package.""" -from pkg_resources import get_distribution +import pkg_resources + +try: + __version__ = pkg_resources.get_distribution("google-cloud-bigtable").version +except pkg_resources.DistributionNotFound: + __version__ = None -__version__ = get_distribution("google-cloud-bigtable").version from google.cloud.bigtable.client import Client diff --git a/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py b/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py index d27154d53..8b1795249 100644 --- a/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py +++ b/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py @@ -49,9 +49,12 @@ from google.protobuf import field_mask_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-bigtable", -).version +try: + _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-bigtable" + ).version +except pkg_resources.DistributionNotFound: + _GAPIC_LIBRARY_VERSION = None class BigtableInstanceAdminClient(object): diff --git a/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py b/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py index acbc4b26f..2f19a880a 100644 --- a/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py +++ b/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py @@ -54,9 +54,14 @@ from google.protobuf import field_mask_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-bigtable", -).version +import pkg_resources + +try: + _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-bigtable" + ).version +except pkg_resources.DistributionNotFound: + _GAPIC_LIBRARY_VERSION = None class BigtableTableAdminClient(object): diff --git a/google/cloud/bigtable_v2/gapic/bigtable_client.py b/google/cloud/bigtable_v2/gapic/bigtable_client.py index 7e544c99e..43ff81029 100644 --- a/google/cloud/bigtable_v2/gapic/bigtable_client.py +++ b/google/cloud/bigtable_v2/gapic/bigtable_client.py @@ -36,9 +36,12 @@ from google.cloud.bigtable_v2.proto import data_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-bigtable", -).version +try: + _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-bigtable" + ).version +except pkg_resources.DistributionNotFound: + _GAPIC_LIBRARY_VERSION = None class BigtableClient(object): diff --git a/samples/beam/requirements.txt b/samples/beam/requirements.txt index 416b381ae..3628e62e5 100644 --- a/samples/beam/requirements.txt +++ b/samples/beam/requirements.txt @@ -1,3 +1,3 @@ apache-beam==2.24.0 -google-cloud-bigtable==1.4.0 -google-cloud-core==1.4.1 \ No newline at end of file +google-cloud-bigtable==1.5.0 +google-cloud-core==1.4.2 \ No newline at end of file diff --git a/samples/hello/requirements.txt b/samples/hello/requirements.txt index 89c7140a1..185b56b7e 100644 --- a/samples/hello/requirements.txt +++ b/samples/hello/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-bigtable==1.4.0 -google-cloud-core==1.4.1 +google-cloud-bigtable==1.5.0 +google-cloud-core==1.4.2 diff --git a/samples/instanceadmin/requirements.txt b/samples/instanceadmin/requirements.txt index 1f3adb6bf..f9c658397 100755 --- a/samples/instanceadmin/requirements.txt +++ b/samples/instanceadmin/requirements.txt @@ -1 +1 @@ -google-cloud-bigtable==1.4.0 +google-cloud-bigtable==1.5.0 diff --git a/samples/metricscaler/requirements.txt b/samples/metricscaler/requirements.txt index b76a5af38..471385ad0 100644 --- a/samples/metricscaler/requirements.txt +++ b/samples/metricscaler/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-bigtable==1.4.0 +google-cloud-bigtable==1.5.0 google-cloud-monitoring==1.1.0 diff --git a/samples/quickstart/requirements.txt b/samples/quickstart/requirements.txt index 1f3adb6bf..f9c658397 100644 --- a/samples/quickstart/requirements.txt +++ b/samples/quickstart/requirements.txt @@ -1 +1 @@ -google-cloud-bigtable==1.4.0 +google-cloud-bigtable==1.5.0 diff --git a/samples/snippets/filters/requirements.txt b/samples/snippets/filters/requirements.txt index 15192cadd..0e902be53 100755 --- a/samples/snippets/filters/requirements.txt +++ b/samples/snippets/filters/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-bigtable==1.4.0 -snapshottest==0.5.1 \ No newline at end of file +google-cloud-bigtable==1.5.0 +snapshottest==0.6.0 \ No newline at end of file diff --git a/samples/snippets/reads/requirements.txt b/samples/snippets/reads/requirements.txt index 15192cadd..0e902be53 100755 --- a/samples/snippets/reads/requirements.txt +++ b/samples/snippets/reads/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-bigtable==1.4.0 -snapshottest==0.5.1 \ No newline at end of file +google-cloud-bigtable==1.5.0 +snapshottest==0.6.0 \ No newline at end of file diff --git a/samples/snippets/writes/requirements.txt b/samples/snippets/writes/requirements.txt index 07d1f44fd..67be6a0ef 100755 --- a/samples/snippets/writes/requirements.txt +++ b/samples/snippets/writes/requirements.txt @@ -1 +1 @@ -google-cloud-bigtable==1.4.0 \ No newline at end of file +google-cloud-bigtable==1.5.0 \ No newline at end of file diff --git a/samples/tableadmin/requirements.txt b/samples/tableadmin/requirements.txt index 1f3adb6bf..f9c658397 100755 --- a/samples/tableadmin/requirements.txt +++ b/samples/tableadmin/requirements.txt @@ -1 +1 @@ -google-cloud-bigtable==1.4.0 +google-cloud-bigtable==1.5.0 diff --git a/setup.py b/setup.py index 1cdd52e02..0f3c9cd82 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = 'google-cloud-bigtable' description = 'Google Cloud Bigtable API client library' -version = "1.5.0" +version = "1.5.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' diff --git a/synth.metadata b/synth.metadata index 73e14bc49..7206c46f8 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/python-bigtable", - "sha": "474b9f3408efa102533da5b9066cba0cd1ff3a9a" + "remote": "https://github.com/googleapis/python-bigtable.git", + "sha": "3861f6b0552e431a1fc7aa872c4d293ca129c28c" } }, { @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9d216d21544b5c9f2c85a6380ffcf20b67e1e459" + "sha": "f3c04883d6c43261ff13db1f52d03a283be06871" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9d216d21544b5c9f2c85a6380ffcf20b67e1e459" + "sha": "f3c04883d6c43261ff13db1f52d03a283be06871" } } ], @@ -49,5 +49,125 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".coveragerc", + ".flake8", + ".github/CONTRIBUTING.md", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/snippet-bot.yml", + ".gitignore", + ".kokoro/build.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/continuous.cfg", + ".kokoro/docker/docs/Dockerfile", + ".kokoro/docker/docs/fetch_gpg_keys.sh", + ".kokoro/docs/common.cfg", + ".kokoro/docs/docs-presubmit.cfg", + ".kokoro/docs/docs.cfg", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/common.cfg", + ".kokoro/presubmit/presubmit.cfg", + ".kokoro/publish-docs.sh", + ".kokoro/release.sh", + ".kokoro/release/common.cfg", + ".kokoro/release/release.cfg", + ".kokoro/samples/lint/common.cfg", + ".kokoro/samples/lint/continuous.cfg", + ".kokoro/samples/lint/periodic.cfg", + ".kokoro/samples/lint/presubmit.cfg", + ".kokoro/samples/python3.6/common.cfg", + ".kokoro/samples/python3.6/continuous.cfg", + ".kokoro/samples/python3.6/periodic.cfg", + ".kokoro/samples/python3.6/presubmit.cfg", + ".kokoro/samples/python3.7/common.cfg", + ".kokoro/samples/python3.7/continuous.cfg", + ".kokoro/samples/python3.7/periodic.cfg", + ".kokoro/samples/python3.7/presubmit.cfg", + ".kokoro/samples/python3.8/common.cfg", + ".kokoro/samples/python3.8/continuous.cfg", + ".kokoro/samples/python3.8/periodic.cfg", + ".kokoro/samples/python3.8/presubmit.cfg", + ".kokoro/test-samples.sh", + ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", + ".trampolinerc", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.rst", + "LICENSE", + "MANIFEST.in", + "docs/_static/custom.css", + "docs/_templates/layout.html", + "docs/conf.py", + "docs/multiprocessing.rst", + "google/cloud/bigtable_admin_v2/__init__.py", + "google/cloud/bigtable_admin_v2/gapic/__init__.py", + "google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py", + "google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client_config.py", + "google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py", + "google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client_config.py", + "google/cloud/bigtable_admin_v2/gapic/enums.py", + "google/cloud/bigtable_admin_v2/gapic/transports/__init__.py", + "google/cloud/bigtable_admin_v2/gapic/transports/bigtable_instance_admin_grpc_transport.py", + "google/cloud/bigtable_admin_v2/gapic/transports/bigtable_table_admin_grpc_transport.py", + "google/cloud/bigtable_admin_v2/proto/__init__.py", + "google/cloud/bigtable_admin_v2/proto/bigtable_instance_admin.proto", + "google/cloud/bigtable_admin_v2/proto/bigtable_instance_admin_pb2.py", + "google/cloud/bigtable_admin_v2/proto/bigtable_instance_admin_pb2_grpc.py", + "google/cloud/bigtable_admin_v2/proto/bigtable_table_admin.proto", + "google/cloud/bigtable_admin_v2/proto/bigtable_table_admin_pb2.py", + "google/cloud/bigtable_admin_v2/proto/bigtable_table_admin_pb2_grpc.py", + "google/cloud/bigtable_admin_v2/proto/common.proto", + "google/cloud/bigtable_admin_v2/proto/common_pb2.py", + "google/cloud/bigtable_admin_v2/proto/common_pb2_grpc.py", + "google/cloud/bigtable_admin_v2/proto/instance.proto", + "google/cloud/bigtable_admin_v2/proto/instance_pb2.py", + "google/cloud/bigtable_admin_v2/proto/instance_pb2_grpc.py", + "google/cloud/bigtable_admin_v2/proto/table.proto", + "google/cloud/bigtable_admin_v2/proto/table_pb2.py", + "google/cloud/bigtable_admin_v2/proto/table_pb2_grpc.py", + "google/cloud/bigtable_admin_v2/types.py", + "google/cloud/bigtable_v2/__init__.py", + "google/cloud/bigtable_v2/gapic/__init__.py", + "google/cloud/bigtable_v2/gapic/bigtable_client.py", + "google/cloud/bigtable_v2/gapic/bigtable_client_config.py", + "google/cloud/bigtable_v2/gapic/transports/__init__.py", + "google/cloud/bigtable_v2/gapic/transports/bigtable_grpc_transport.py", + "google/cloud/bigtable_v2/proto/__init__.py", + "google/cloud/bigtable_v2/proto/bigtable.proto", + "google/cloud/bigtable_v2/proto/bigtable_pb2.py", + "google/cloud/bigtable_v2/proto/bigtable_pb2_grpc.py", + "google/cloud/bigtable_v2/proto/data.proto", + "google/cloud/bigtable_v2/proto/data_pb2.py", + "google/cloud/bigtable_v2/proto/data_pb2_grpc.py", + "google/cloud/bigtable_v2/types.py", + "renovate.json", + "samples/AUTHORING_GUIDE.md", + "samples/CONTRIBUTING.md", + "samples/README.md", + "samples/hello/README.md", + "samples/hello_happybase/README.md", + "samples/instanceadmin/README.md", + "samples/metricscaler/README.md", + "samples/quickstart/README.md", + "samples/quickstart_happybase/README.md", + "samples/snippets/README.md", + "samples/tableadmin/README.md", + "scripts/decrypt-secrets.sh", + "scripts/readme-gen/readme_gen.py", + "scripts/readme-gen/templates/README.tmpl.rst", + "scripts/readme-gen/templates/auth.tmpl.rst", + "scripts/readme-gen/templates/auth_api_key.tmpl.rst", + "scripts/readme-gen/templates/install_deps.tmpl.rst", + "scripts/readme-gen/templates/install_portaudio.tmpl.rst", + "setup.cfg", + "testing/.gitignore", + "tests/unit/gapic/v2/test_bigtable_client_v2.py", + "tests/unit/gapic/v2/test_bigtable_instance_admin_client_v2.py", + "tests/unit/gapic/v2/test_bigtable_table_admin_client_v2.py" ] } \ No newline at end of file diff --git a/tests/system.py b/tests/system.py index 50dc5c31d..92bd582a3 100644 --- a/tests/system.py +++ b/tests/system.py @@ -18,6 +18,7 @@ import time import unittest +from google.api_core.exceptions import DeadlineExceeded from google.api_core.exceptions import TooManyRequests from google.cloud.environment_vars import BIGTABLE_EMULATOR from test_utils.retry import RetryErrors @@ -831,7 +832,8 @@ def test_delete_column_family(self): col_fams = temp_table.list_column_families() self.assertEqual(list(col_fams.keys()), [COLUMN_FAMILY_ID1]) - column_family.delete() + retry_504 = RetryErrors(DeadlineExceeded) + retry_504(column_family.delete)() # Make sure we have successfully deleted it. self.assertEqual(temp_table.list_column_families(), {})