diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 9ee60f7..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:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b
+ digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803
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/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/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/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",
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/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/owlbot.py b/owlbot.py
index a7a1462..de41109 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -31,8 +31,51 @@
# ----------------------------------------------------------------------------
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
+# 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
# ----------------------------------------------------------------------------
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
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 = [
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)