diff --git a/README.rst b/README.rst index ffdb5e08..28e6f39a 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,35 @@ -Python Client for Google Cloud Pubsublite API -================================================= +Python Client for Pub/Sub Lite API +================================== + +|stable| |pypi| |versions| + +`Pub/Sub Lite API`_: is designed to provide reliable, +many-to-many, asynchronous messaging between applications. Publisher +applications can send messages to a topic and other applications can +subscribe to that topic to receive the messages. By decoupling senders and +receivers, Google Cloud Pub/Sub allows developers to communicate between +independently written applications. + +Compared to Google Pub/Sub, Pub/Sub Lite provides partitioned zonal data +storage with predefined capacity. Both products present a similar API, but +Pub/Sub Lite has more usage caveats. + +See the [Google Pub/Sub Lite docs](https://cloud.google.com/pubsub/quickstart-console#before-you-begin) for more details on how to activate +Pub/Sub Lite for your project, as well as guidance on how to choose between +Cloud Pub/Sub and Pub/Sub Lite. + +- `Client Library Documentation`_ +- `Product Documentation`_ + +.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels +.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-pubsublite.svg + :target: https://pypi.org/project/google-cloud-pubsublite/ +.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-pubsublite.svg + :target: https://pypi.org/project/google-cloud-pubsublite/ +.. _Pub/Sub Lite API: https://cloud.google.com/pubsub/lite +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/pubsublite/latest +.. _Product Documentation: https://cloud.google.com/pubsub/lite Quick Start ----------- @@ -8,11 +38,12 @@ In order to use this library, you first need to go through the following steps: 1. `Select or create a Cloud Platform project.`_ 2. `Enable billing for your project.`_ -3. Enable the Google Cloud Pubsublite API. +3. `Enable the Pub/Sub Lite API.`_ 4. `Setup Authentication.`_ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Enable the Pub/Sub Lite API.: https://cloud.google.com/pubsub/lite .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -29,14 +60,40 @@ dependencies. .. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ +Code samples and snippets +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Code samples and snippets live in the `samples/` folder. + + +Supported Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^ +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of +Python. + +Python >= 3.7 + +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches + +Unsupported Python Versions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Python <= 3.6 + +If you are using an `end-of-life`_ +version of Python, we recommend that you update as soon as possible to an actively supported version. + +.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches + Mac/Linux ^^^^^^^^^ .. code-block:: console - python3 -m venv + pip install virtualenv + virtualenv source /bin/activate - /bin/pip install /path/to/library + /bin/pip install google-cloud-pubsublite Windows @@ -44,6 +101,20 @@ Windows .. code-block:: console - python3 -m venv + pip install virtualenv + virtualenv \Scripts\activate - \Scripts\pip.exe install \path\to\library + \Scripts\pip.exe install google-cloud-pubsublite + +Next Steps +~~~~~~~~~~ + +- Read the `Client Library Documentation`_ for Pub/Sub Lite API + to see other available methods on the client. +- Read the `Pub/Sub Lite API Product documentation`_ to learn + more about the product and see How-to Guides. +- View this `README`_ to see the full list of Cloud + APIs that we cover. + +.. _Pub/Sub Lite API Product documentation: https://cloud.google.com/pubsub/lite +.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst diff --git a/google/cloud/pubsublite_v1/services/cursor_service/async_client.py b/google/cloud/pubsublite_v1/services/cursor_service/async_client.py index 06fad454..c820cbfa 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/async_client.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/async_client.py @@ -270,8 +270,8 @@ def request_generator(): Args: requests (AsyncIterator[`google.cloud.pubsublite_v1.types.StreamingCommitCursorRequest`]): - The request object AsyncIterator. A request sent from the client to - the server on a stream. + The request object AsyncIterator. A request sent from the client to the + server on a stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/pubsublite_v1/services/cursor_service/client.py b/google/cloud/pubsublite_v1/services/cursor_service/client.py index 4be3540a..3da96c4a 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/client.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/client.py @@ -494,8 +494,8 @@ def request_generator(): Args: requests (Iterator[google.cloud.pubsublite_v1.types.StreamingCommitCursorRequest]): - The request object iterator. A request sent from the client to - the server on a stream. + The request object iterator. A request sent from the client to the + server on a stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/pubsublite_v1/services/subscriber_service/async_client.py b/google/cloud/pubsublite_v1/services/subscriber_service/async_client.py index 39a07115..6d83859e 100644 --- a/google/cloud/pubsublite_v1/services/subscriber_service/async_client.py +++ b/google/cloud/pubsublite_v1/services/subscriber_service/async_client.py @@ -265,8 +265,8 @@ def request_generator(): Args: requests (AsyncIterator[`google.cloud.pubsublite_v1.types.SubscribeRequest`]): - The request object AsyncIterator. A request sent from the client to - the server on a stream. + The request object AsyncIterator. A request sent from the client to the + server on a stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/pubsublite_v1/services/subscriber_service/client.py b/google/cloud/pubsublite_v1/services/subscriber_service/client.py index 2ef3e753..6e9b815c 100644 --- a/google/cloud/pubsublite_v1/services/subscriber_service/client.py +++ b/google/cloud/pubsublite_v1/services/subscriber_service/client.py @@ -471,8 +471,8 @@ def request_generator(): Args: requests (Iterator[google.cloud.pubsublite_v1.types.SubscribeRequest]): - The request object iterator. A request sent from the client to - the server on a stream. + The request object iterator. A request sent from the client to the + server on a stream. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/pubsublite_v1/services/topic_stats_service/async_client.py b/google/cloud/pubsublite_v1/services/topic_stats_service/async_client.py index 843a5e46..7069c342 100644 --- a/google/cloud/pubsublite_v1/services/topic_stats_service/async_client.py +++ b/google/cloud/pubsublite_v1/services/topic_stats_service/async_client.py @@ -345,8 +345,8 @@ async def sample_compute_head_cursor(): Args: request (Optional[Union[google.cloud.pubsublite_v1.types.ComputeHeadCursorRequest, dict]]): - The request object. Compute the current head cursor for - a partition. + The request object. Compute the current head cursor for a + partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -428,7 +428,8 @@ async def sample_compute_time_cursor(): Args: request (Optional[Union[google.cloud.pubsublite_v1.types.ComputeTimeCursorRequest, dict]]): The request object. Compute the corresponding cursor for - a publish or event time in a topic partition. + a publish or event time in a topic + partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/pubsublite_v1/services/topic_stats_service/client.py b/google/cloud/pubsublite_v1/services/topic_stats_service/client.py index 22009f16..65981bbe 100644 --- a/google/cloud/pubsublite_v1/services/topic_stats_service/client.py +++ b/google/cloud/pubsublite_v1/services/topic_stats_service/client.py @@ -573,8 +573,8 @@ def sample_compute_head_cursor(): Args: request (Union[google.cloud.pubsublite_v1.types.ComputeHeadCursorRequest, dict]): - The request object. Compute the current head cursor for - a partition. + The request object. Compute the current head cursor for a + partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -657,7 +657,8 @@ def sample_compute_time_cursor(): Args: request (Union[google.cloud.pubsublite_v1.types.ComputeTimeCursorRequest, dict]): The request object. Compute the corresponding cursor for - a publish or event time in a topic partition. + a publish or event time in a topic + partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/owlbot.py b/owlbot.py index fd0b063b..c964ab3b 100644 --- a/owlbot.py +++ b/owlbot.py @@ -49,7 +49,9 @@ "scripts/fixup*.py", # new libraries do not need the keyword fixup script "setup.py", "testing/constraints-3.7.txt", + "testing/constraints-3.8.txt", "google/cloud/pubsublite/__init__.py", + "README.rst", ], ) s.remove_staging_dirs() diff --git a/samples/generated_samples/snippet_metadata_google.cloud.pubsublite.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.pubsublite.v1.json index 5d1830d9..b2b99995 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.pubsublite.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.pubsublite.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-pubsublite", - "version": "1.8.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt index ed7f9aed..14252f79 100644 --- a/testing/constraints-3.8.txt +++ b/testing/constraints-3.8.txt @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- -# This constraints file is required for unit tests. +# This constraints file is used to check that lower bounds +# are correct in setup.py # List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf +# Pin the version to the lower bound. +google-cloud-pubsub==2.10.0 +grpcio==1.38.1 +grpcio-status==1.38.1 +overrides==6.0.1 +google-api-core==1.33.2