From 109c90f01320c11ea695a7bedd2cec7cd5ad6b1c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:56:06 +0000 Subject: [PATCH 1/6] chore(python): avoid `.nox` directories when building docs (#14) Source-Link: https://github.com/googleapis/synthtool/commit/7e1f6da50524b5d98eb67adbf6dd0805df54233d Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7..b771c37 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d diff --git a/docs/conf.py b/docs/conf.py index b45d2cf..c59dd39 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", From d3266bd1e920946b78345ee25306dde9d0e6ed4f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:26:20 -0400 Subject: [PATCH 2/6] chore: drop mention of Python 2.7 from templates (#15) Source-Link: https://github.com/googleapis/synthtool/commit/facee4cc1ea096cd8bcc008bb85929daa7c414c0 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- noxfile.py | 12 +++++++++--- scripts/readme-gen/templates/install_deps.tmpl.rst | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b771c37..a9fcd07 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d + digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 diff --git a/noxfile.py b/noxfile.py index d896e7f..935a924 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406db..275d649 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash From ced21f4987c00bef8b37e1ba94c11e2c299cc2a3 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Wed, 18 Aug 2021 07:41:06 -0600 Subject: [PATCH 3/6] chore: generate python samples templates in owlbot.py (#16) Generate python samples templates in owlbot.py --- owlbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owlbot.py b/owlbot.py index a7a1462..8d4a8ae 100644 --- a/owlbot.py +++ b/owlbot.py @@ -31,6 +31,7 @@ # ---------------------------------------------------------------------------- templated_files = gcp.CommonTemplates().py_library(microgenerator=True) +python.py_samples(skip_readmes=True) s.move(templated_files, excludes=[".coveragerc"]) # the microgenerator has a good coveragerc file # ---------------------------------------------------------------------------- From 4588eab7b9b15e2eef0b8afc2c4893f37e78769b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 19 Aug 2021 11:33:05 -0400 Subject: [PATCH 4/6] chore: migrate default branch from master to main (#17) --- .kokoro/build.sh | 2 +- .kokoro/test-samples-impl.sh | 2 +- CONTRIBUTING.rst | 12 +++++------ owlbot.py | 42 ++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 82fc753..79985fc 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d5..8a324c9 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a1daabc..c5860ea 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-datastream # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-datastream.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date version of ``python-datastream``. The the suggested remote name ``upstream`` should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + the branch should be the main branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-datastream/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-datastream/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-datastream @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-datastream/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-datastream/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/owlbot.py b/owlbot.py index 8d4a8ae..de41109 100644 --- a/owlbot.py +++ b/owlbot.py @@ -34,6 +34,48 @@ python.py_samples(skip_readmes=True) s.move(templated_files, excludes=[".coveragerc"]) # the microgenerator has a good coveragerc file +# Remove the replacements below once https://github.com/googleapis/synthtool/pull/1188 is merged + +# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files +s.replace(".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main") + +# Customize CONTRIBUTING.rst to replace master with main +s.replace( + "CONTRIBUTING.rst", + "fetch and merge changes from upstream into master", + "fetch and merge changes from upstream into main", +) + +s.replace( + "CONTRIBUTING.rst", + "git merge upstream/master", + "git merge upstream/main", +) + +s.replace( + "CONTRIBUTING.rst", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", +) + +s.replace( + "CONTRIBUTING.rst", + "remote \(``master``\)", + "remote (``main``)", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/CONTRIBUTING.rst", + "blob/main/CONTRIBUTING.rst", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/noxfile.py", + "blob/main/noxfile.py", +) + # ---------------------------------------------------------------------------- # Run blacken session # ---------------------------------------------------------------------------- From 296962abf8d0b8cda4f3e1e978262c8628f4b31e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 12:54:27 +0000 Subject: [PATCH 5/6] fix(datastream): Change a few resource pattern variables from camelCase to snake_case (#20) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 393705818 Source-Link: https://github.com/googleapis/googleapis/commit/9e99074fc73529d946fca7914deb0d21968f03d8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1eee1fcf28b8d8557bd8358d00181ebefffc4a7d --- .../services/datastream/client.py | 24 +++++++-------- .../datastream_v1alpha1/test_datastream.py | 30 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/google/cloud/datastream_v1alpha1/services/datastream/client.py b/google/cloud/datastream_v1alpha1/services/datastream/client.py index e2c3c32..870fecf 100644 --- a/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/google/cloud/datastream_v1alpha1/services/datastream/client.py @@ -161,49 +161,49 @@ def transport(self) -> DatastreamTransport: @staticmethod def connection_profile_path( - project: str, location: str, connectionProfile: str, + project: str, location: str, connection_profile: str, ) -> str: """Returns a fully-qualified connection_profile string.""" - return "projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}".format( - project=project, location=location, connectionProfile=connectionProfile, + return "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format( + project=project, location=location, connection_profile=connection_profile, ) @staticmethod def parse_connection_profile_path(path: str) -> Dict[str, str]: """Parses a connection_profile path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/connectionProfiles/(?P.+?)$", + r"^projects/(?P.+?)/locations/(?P.+?)/connectionProfiles/(?P.+?)$", path, ) return m.groupdict() if m else {} @staticmethod def private_connection_path( - project: str, location: str, privateConnection: str, + project: str, location: str, private_connection: str, ) -> str: """Returns a fully-qualified private_connection string.""" - return "projects/{project}/locations/{location}/privateConnections/{privateConnection}".format( - project=project, location=location, privateConnection=privateConnection, + return "projects/{project}/locations/{location}/privateConnections/{private_connection}".format( + project=project, location=location, private_connection=private_connection, ) @staticmethod def parse_private_connection_path(path: str) -> Dict[str, str]: """Parses a private_connection path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/privateConnections/(?P.+?)$", + r"^projects/(?P.+?)/locations/(?P.+?)/privateConnections/(?P.+?)$", path, ) return m.groupdict() if m else {} @staticmethod def route_path( - project: str, location: str, privateConnection: str, route: str, + project: str, location: str, private_connection: str, route: str, ) -> str: """Returns a fully-qualified route string.""" - return "projects/{project}/locations/{location}/privateConnections/{privateConnection}/routes/{route}".format( + return "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}".format( project=project, location=location, - privateConnection=privateConnection, + private_connection=private_connection, route=route, ) @@ -211,7 +211,7 @@ def route_path( def parse_route_path(path: str) -> Dict[str, str]: """Parses a route path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/privateConnections/(?P.+?)/routes/(?P.+?)$", + r"^projects/(?P.+?)/locations/(?P.+?)/privateConnections/(?P.+?)/routes/(?P.+?)$", path, ) return m.groupdict() if m else {} diff --git a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 60855bc..ccbd965 100644 --- a/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -6046,12 +6046,12 @@ def test_datastream_grpc_lro_async_client(): def test_connection_profile_path(): project = "squid" location = "clam" - connectionProfile = "whelk" - expected = "projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}".format( - project=project, location=location, connectionProfile=connectionProfile, + connection_profile = "whelk" + expected = "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format( + project=project, location=location, connection_profile=connection_profile, ) actual = DatastreamClient.connection_profile_path( - project, location, connectionProfile + project, location, connection_profile ) assert expected == actual @@ -6060,7 +6060,7 @@ def test_parse_connection_profile_path(): expected = { "project": "octopus", "location": "oyster", - "connectionProfile": "nudibranch", + "connection_profile": "nudibranch", } path = DatastreamClient.connection_profile_path(**expected) @@ -6072,12 +6072,12 @@ def test_parse_connection_profile_path(): def test_private_connection_path(): project = "cuttlefish" location = "mussel" - privateConnection = "winkle" - expected = "projects/{project}/locations/{location}/privateConnections/{privateConnection}".format( - project=project, location=location, privateConnection=privateConnection, + private_connection = "winkle" + expected = "projects/{project}/locations/{location}/privateConnections/{private_connection}".format( + project=project, location=location, private_connection=private_connection, ) actual = DatastreamClient.private_connection_path( - project, location, privateConnection + project, location, private_connection ) assert expected == actual @@ -6086,7 +6086,7 @@ def test_parse_private_connection_path(): expected = { "project": "nautilus", "location": "scallop", - "privateConnection": "abalone", + "private_connection": "abalone", } path = DatastreamClient.private_connection_path(**expected) @@ -6098,15 +6098,15 @@ def test_parse_private_connection_path(): def test_route_path(): project = "squid" location = "clam" - privateConnection = "whelk" + private_connection = "whelk" route = "octopus" - expected = "projects/{project}/locations/{location}/privateConnections/{privateConnection}/routes/{route}".format( + expected = "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}".format( project=project, location=location, - privateConnection=privateConnection, + private_connection=private_connection, route=route, ) - actual = DatastreamClient.route_path(project, location, privateConnection, route) + actual = DatastreamClient.route_path(project, location, private_connection, route) assert expected == actual @@ -6114,7 +6114,7 @@ def test_parse_route_path(): expected = { "project": "oyster", "location": "nudibranch", - "privateConnection": "cuttlefish", + "private_connection": "cuttlefish", "route": "mussel", } path = DatastreamClient.route_path(**expected) From bfa5cb8e8f91451dc657fcdde26c5b24316ef512 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:02:12 +0000 Subject: [PATCH 6/6] chore: release 0.1.3 (#21) :robot: I have created a release \*beep\* \*boop\* --- ### [0.1.3](https://www.github.com/googleapis/python-datastream/compare/v0.1.2...v0.1.3) (2021-08-30) ### Bug Fixes * **datastream:** Change a few resource pattern variables from camelCase to snake_case ([#20](https://www.github.com/googleapis/python-datastream/issues/20)) ([296962a](https://www.github.com/googleapis/python-datastream/commit/296962abf8d0b8cda4f3e1e978262c8628f4b31e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 651e8e5..7461211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [0.1.3](https://www.github.com/googleapis/python-datastream/compare/v0.1.2...v0.1.3) (2021-08-30) + + +### Bug Fixes + +* **datastream:** Change a few resource pattern variables from camelCase to snake_case ([#20](https://www.github.com/googleapis/python-datastream/issues/20)) ([296962a](https://www.github.com/googleapis/python-datastream/commit/296962abf8d0b8cda4f3e1e978262c8628f4b31e)) + ### [0.1.2](https://www.github.com/googleapis/python-datastream/compare/v0.1.1...v0.1.2) (2021-07-29) diff --git a/setup.py b/setup.py index df0be69..2ed2f30 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-datastream" description = "Datastream client library" -version = "0.1.2" +version = "0.1.3" release_status = "Development Status :: 3 - Alpha" url = "https://github.com/googleapis/python-datastream" dependencies = [