Skip to content

Commit

Permalink
chore: update templated files (#822)
Browse files Browse the repository at this point in the history
* chore(python): drop python 3.6

Source-Link: googleapis/synthtool@4f89b13
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c

* add api_description to .repo-metadata.json

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2022
1 parent 9e5329c commit 836cc5c
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32
# created: 2022-05-05T22:08:23.383410683Z
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
# created: 2022-07-05T18:31:20.838186805Z
7 changes: 7 additions & 0 deletions .kokoro/continuous/prerelease-deps.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "prerelease_deps"
}
7 changes: 7 additions & 0 deletions .kokoro/presubmit/prerelease-deps.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "prerelease_deps"
}
4 changes: 2 additions & 2 deletions .kokoro/test-samples-impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export PYTHONUNBUFFERED=1
env | grep KOKORO

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.9 -m pip install --upgrade --quiet nox

# Use secrets acessor service account to get secrets
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
Expand Down Expand Up @@ -76,7 +76,7 @@ for file in samples/**/requirements.txt; do
echo "------------------------------------------------------------"

# Use nox to execute the tests for the project.
python3.6 -m nox -s "$RUN_TESTS_SESSION"
python3.9 -m nox -s "$RUN_TESTS_SESSION"
EXIT=$?

# If this is a periodic build, send the test log to the FlakyBot.
Expand Down
3 changes: 2 additions & 1 deletion .repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"requires_billing": true,
"default_version": "",
"codeowner_team": "@googleapis/cloud-storage-dpe",
"api_shortname": "storage"
"api_shortname": "storage",
"api_description": "is a durable and highly available object storage service. Google Cloud Storage is almost infinitely scalable and guarantees consistency: when a write succeeds, the latest copy of the object will be returned to any GET, globally."
}
118 changes: 48 additions & 70 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
Python Client for Google Cloud Storage
======================================
Python Client for Google Cloud Storage API
==========================================

|GA| |pypi| |versions|
|stable| |pypi| |versions|

`Google Cloud Storage`_ allows you to store data on
Google infrastructure with very high reliability, performance and
availability, and can be used to distribute large data objects to users
via direct download.
`Google Cloud Storage API`_: is a durable and highly available object storage service. Google Cloud Storage is almost infinitely scalable and guarantees consistency: when a write succeeds, the latest copy of the object will be returned to any GET, globally.

- `Client Library Documentation`_
- `Storage API docs`_
- `Product Documentation`_

.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability
.. |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-storage.svg
:target: https://pypi.org/project/google-cloud-storage
:target: https://pypi.org/project/google-cloud-storage/
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-storage.svg
:target: https://pypi.org/project/google-cloud-storage
.. _Google Cloud Storage: https://cloud.google.com/storage/docs
.. _Client Library Documentation: https://googleapis.dev/python/storage/latest
.. _Storage API docs: https://cloud.google.com/storage/docs/json_api/v1
:target: https://pypi.org/project/google-cloud-storage/
.. _Google Cloud Storage API: https://cloud.google.com/storage
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/storage/latest
.. _Product Documentation: https://cloud.google.com/storage

Quick Start
-----------
Expand All @@ -34,92 +31,73 @@ In order to use this library, you first need to go through the following steps:
.. _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 Google Cloud Storage API.: https://cloud.google.com/storage
.. _Setup Authentication.: https://cloud.google.com/storage/docs/reference/libraries#setting_up_authentication
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html

Installation
~~~~~~~~~~~~

`Set up a Python development environment`_ and install this library in a `venv`.
`venv`_ is a tool to create isolated Python environments. The basic problem it
addresses is one of dependencies and versions, and indirectly permissions.
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
create isolated Python environments. The basic problem it addresses is one of
dependencies and versions, and indirectly permissions.

Make sure you're using Python 3.7 or later, which includes `venv`_ by default.
With `venv`, it's possible to install this library without needing system
With `virtualenv`_, it's possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.

.. _Set up a Python development environment: https://cloud.google.com/python/docs/setup
.. _`venv`: https://docs.python.org/3/library/venv.html
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/


Code samples and snippets
~~~~~~~~~~~~~~~~~~~~~~~~~

Code samples and snippets live in the `samples/` folder.


Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.7
Our client libraries are compatible with all current [active](https://devguide.python.org/devcycle/#in-development-main-branch) and [maintenance](https://devguide.python.org/devcycle/#maintenance-branches) versions of
Python.

Deprecated Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.7

Unsupported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Python <= 3.6

Python == 3.6: the last released version which supported Python 3.6 was
``google-cloud-storage 2.0.0``, released 2022-01-12.

Python == 3.5: the last released version which supported Python 3.5 was
``google-cloud-storage 1.32.0``, released 2020-10-16.
If you are using an [end-of-life](https://devguide.python.org/devcycle/#end-of-life-branches)
version of Python, we recommend that you update as soon as possible to an actively supported version.

Python == 2.7: the last released version which supported Python 2.7 was
``google-cloud-storage 1.44.0``, released 2022-01-05.

Mac/Linux
^^^^^^^^^

.. code-block:: console
python -m venv env
source env/bin/activate
pip install google-cloud-storage
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-storage
Windows
^^^^^^^

.. code-block:: console
py -m venv env
.\env\Scripts\activate
pip install google-cloud-storage
Example Usage
~~~~~~~~~~~~~

.. code:: python
# Imports the Google Cloud client library
from google.cloud import storage
# Instantiates a client
client = storage.Client()
# Creates a new bucket and uploads an object
new_bucket = client.create_bucket('new-bucket-id')
new_blob = new_bucket.blob('remote/path/storage.txt')
new_blob.upload_from_filename(filename='/local/path.txt')
# Retrieve an existing bucket
# https://console.cloud.google.com/storage/browser/[bucket-id]/
bucket = client.get_bucket('bucket-id')
# Then do other things...
blob = bucket.get_blob('remote/path/to/file.txt')
print(blob.download_as_bytes())
blob.upload_from_string('New contents!')
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-storage
What's Next
~~~~~~~~~~~
Next Steps
~~~~~~~~~~

Now that you've set up your Python client for Cloud Storage,
you can get started running `Storage samples.`_
- Read the `Client Library Documentation`_ for Google Cloud Storage API
to see other available methods on the client.
- Read the `Google Cloud Storage 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.

.. _Storage samples.: https://github.com/googleapis/python-storage/tree/main/samples
.. _Google Cloud Storage API Product documentation: https://cloud.google.com/storage
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
2 changes: 1 addition & 1 deletion samples/snippets/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to test samples.
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/readme-gen/templates/install_deps.tmpl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 3.6+.
#. Create a virtualenv. Samples are compatible with Python 3.7+.

.. code-block:: bash
Expand Down

0 comments on commit 836cc5c

Please sign in to comment.