This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move samples from python-docs-samples (#41)
* Add initial Secret Manager samples [(#2664)](GoogleCloudPlatform/python-docs-samples#2664) * Bump secretmanager version [(#2699)](GoogleCloudPlatform/python-docs-samples#2699) This bumps to the version that doesn't have a bunch of deprecation warnings. * Fix a small comment typo [(#2714)](GoogleCloudPlatform/python-docs-samples#2714) * Add Secret Manager IAM samples [(#2749)](GoogleCloudPlatform/python-docs-samples#2749) * Add Secret Manager IAM samples * Use an envvar for the iam user * Add env var to secrets. Co-authored-by: Kurtis Van Gent <[email protected]> * SecretManager update v1beta1->v1 [(#3065)](GoogleCloudPlatform/python-docs-samples#3065) Client library has been updated: https://pypi.org/project/google-cloud-secret-manager/ * Simplify noxfile setup. [(#2806)](GoogleCloudPlatform/python-docs-samples#2806) * chore(deps): update dependency requests to v2.23.0 * Simplify noxfile and add version control. * Configure appengine/standard to only test Python 2.7. * Update Kokokro configs to match noxfile. * Add requirements-test to each folder. * Remove Py2 versions from everything execept appengine/standard. * Remove conftest.py. * Remove appengine/standard/conftest.py * Remove 'no-sucess-flaky-report' from pytest.ini. * Add GAE SDK back to appengine/standard tests. * Fix typo. * Roll pytest to python 2 version. * Add a bunch of testing requirements. * Remove typo. * Add appengine lib directory back in. * Add some additional requirements. * Fix issue with flake8 args. * Even more requirements. * Readd appengine conftest.py. * Add a few more requirements. * Even more Appengine requirements. * Add webtest for appengine/standard/mailgun. * Add some additional requirements. * Add workaround for issue with mailjet-rest. * Add responses for appengine/standard/mailjet. Co-authored-by: Renovate Bot <[email protected]> * chore: some lint fixes [(#3749)](GoogleCloudPlatform/python-docs-samples#3749) * chore(deps): update dependency google-cloud-secret-manager to v1 [(#3846)](GoogleCloudPlatform/python-docs-samples#3846) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [google-cloud-secret-manager](https://togithub.com/googleapis/python-secret-manager) | major | `==0.2.0` -> `==1.0.0` | --- ### Release Notes <details> <summary>googleapis/python-secret-manager</summary> ### [`v1.0.0`](https://togithub.com/googleapis/python-secret-manager/blob/master/CHANGELOG.md#​100-httpswwwgithubcomgoogleapispython-secret-managercomparev020v100-2020-05-20) [Compare Source](https://togithub.com/googleapis/python-secret-manager/compare/v0.2.0...v1.0.0) ##### Features - release as production/stable ([#​24](https://www.github.com/googleapis/python-secret-manager/issues/24)) ([39a8cc8](https://www.github.com/googleapis/python-secret-manager/commit/39a8cc8f631569c82d1cbffc6a9bbb440d380683)) </details> --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples). * Replace GCLOUD_PROJECT with GOOGLE_CLOUD_PROJECT. [(#4022)](GoogleCloudPlatform/python-docs-samples#4022) * chore(deps): update dependency pytest to v5.4.3 [(#4279)](GoogleCloudPlatform/python-docs-samples#4279) * chore(deps): update dependency pytest to v5.4.3 * specify pytest for python 2 in appengine Co-authored-by: Leah Cole <[email protected]> * Update dependency pytest to v6 [(#4390)](GoogleCloudPlatform/python-docs-samples#4390) * chore: update templates Co-authored-by: Seth Vargo <[email protected]> Co-authored-by: Kurtis Van Gent <[email protected]> Co-authored-by: gwhitehawk <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Takashi Matsuo <[email protected]> Co-authored-by: Leah Cole <[email protected]>
- Loading branch information
1 parent
82bac1b
commit 538071b
Showing
39 changed files
with
2,691 additions
and
34 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Code owners file. | ||
# This file controls who is tagged for review for any given pull request. | ||
# | ||
# For syntax help see: | ||
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax | ||
|
||
|
||
/samples/**/*.py @googleapis/python-samples-owners |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# Ensure local Python is preferred over distribution Python. | ||
ENV PATH /usr/local/bin:$PATH | ||
|
||
# Install dependencies. | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
apt-transport-https \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
dirmngr \ | ||
git \ | ||
gpg-agent \ | ||
graphviz \ | ||
libbz2-dev \ | ||
libdb5.3-dev \ | ||
libexpat1-dev \ | ||
libffi-dev \ | ||
liblzma-dev \ | ||
libreadline-dev \ | ||
libsnappy-dev \ | ||
libssl-dev \ | ||
libsqlite3-dev \ | ||
portaudio19-dev \ | ||
redis-server \ | ||
software-properties-common \ | ||
ssh \ | ||
sudo \ | ||
tcl \ | ||
tcl-dev \ | ||
tk \ | ||
tk-dev \ | ||
uuid-dev \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& add-apt-repository universe \ | ||
&& apt-get update \ | ||
&& apt-get -y install jq \ | ||
&& apt-get clean autoclean \ | ||
&& apt-get autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -f /var/cache/apt/archives/*.deb | ||
|
||
|
||
COPY fetch_gpg_keys.sh /tmp | ||
# Install the desired versions of Python. | ||
RUN set -ex \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \ | ||
&& /tmp/fetch_gpg_keys.sh \ | ||
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \ | ||
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ | ||
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ | ||
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \ | ||
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \ | ||
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \ | ||
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \ | ||
&& rm python-${PYTHON_VERSION}.tar.xz \ | ||
&& cd /usr/src/python-${PYTHON_VERSION} \ | ||
&& ./configure \ | ||
--enable-shared \ | ||
# This works only on Python 2.7 and throws a warning on every other | ||
# version, but seems otherwise harmless. | ||
--enable-unicode=ucs4 \ | ||
--with-system-ffi \ | ||
--without-ensurepip \ | ||
&& make -j$(nproc) \ | ||
&& make install \ | ||
&& ldconfig \ | ||
; done \ | ||
&& rm -rf "${GNUPGHOME}" \ | ||
&& rm -rf /usr/src/python* \ | ||
&& rm -rf ~/.cache/ | ||
|
||
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ | ||
&& python3.7 /tmp/get-pip.py \ | ||
&& python3.8 /tmp/get-pip.py \ | ||
&& rm /tmp/get-pip.py | ||
|
||
CMD ["python3.7"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# A script to fetch gpg keys with retry. | ||
# Avoid jinja parsing the file. | ||
# | ||
|
||
function retry { | ||
if [[ "${#}" -le 1 ]]; then | ||
echo "Usage: ${0} retry_count commands.." | ||
exit 1 | ||
fi | ||
local retries=${1} | ||
local command="${@:2}" | ||
until [[ "${retries}" -le 0 ]]; do | ||
$command && return 0 | ||
if [[ $? -ne 0 ]]; then | ||
echo "command failed, retrying" | ||
((retries--)) | ||
fi | ||
done | ||
return 1 | ||
} | ||
|
||
# 3.6.9, 3.7.5 (Ned Deily) | ||
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ | ||
0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D | ||
|
||
# 3.8.0 (Łukasz Langa) | ||
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ | ||
E3FF2839C048B25C084DEBE9B26995E310250568 | ||
|
||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
env_vars: { | ||
key: "STAGING_BUCKET" | ||
value: "gcloud-python-test" | ||
} | ||
|
||
env_vars: { | ||
key: "V2_STAGING_BUCKET" | ||
value: "gcloud-python-test" | ||
} | ||
|
||
# We only upload the image in the main `docs` build. | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE_UPLOAD" | ||
value: "false" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.