Skip to content

Conversation

jinglundong
Copy link
Contributor

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

@jinglundong jinglundong requested review from a team as code owners March 7, 2023 22:24
@snippet-bot
Copy link

snippet-bot bot commented Mar 7, 2023

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: storage Issues related to the Cloud Storage API. labels Mar 7, 2023
Copy link
Contributor

@engelke engelke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. See comments, but they are just advice.

operating_system: "ubuntu22"
# We also support 3.8, 3.9 and 3.10.
# See https://cloud.google.com/appengine/docs/flexible/python/runtime#interpreter for more info.
runtime_version: "3.11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put this above the comment, since otherwise it looks like the comment is talking about ubuntu versions, not python ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rearranged them. The operating_system could go after.

  # We also support 3.8, 3.9 and 3.10.
  # See https://cloud.google.com/appengine/docs/flexible/python/runtime#interpreter for more info.
  runtime_version: "3.11"
  operating_system: "ubuntu22"


#[START gae_flex_storage_yaml]
env_variables:
CLOUD_STORAGE_BUCKET: your-bucket-name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps [your-bucket-name] instead, as shown in the README for running locally. It draws attention to the need to edit the value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -0,0 +1,2 @@
pytest==7.0.1
google-cloud-storage==2.1.0; python_version > '3.6'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you aren't allowing versions less than 3.7 anyway, the "; python_version > '3.6." isn't really needed. There's no alternate requirement for lower Python version.

from google.cloud import storage
import pytest
import requests
from six import BytesIO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use io.BytesIO? There's no need to support older Python versions here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'm changing it to io.BytesIO.

@jinglundong jinglundong merged commit f2f9e9c into main Mar 8, 2023
@jinglundong jinglundong deleted the flex-ubuntu-storage branch March 8, 2023 18:08
telpirion pushed a commit that referenced this pull request Mar 13, 2023
* Add a python 3.11 storage app for App Engine Flex.

* This is a python 3.11 sample app. Remove references to other versions.

* Update header.

* Update the tag and copyright header.

* Address PR comments. Remove references and usage of older python versions.

* Fix an import issue.

* Fix lint.

---------

Co-authored-by: Maciej Strzelczyk <strzelczyk@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants