Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3fcf98f
Python KMS Apiary P1 samples [(#779)](https://github.com/GoogleCloudP…
ryanmats Feb 7, 2017
1f3c3b9
random generation of keyring / cryptokey names [(#786)](https://githu…
ryanmats Feb 8, 2017
d3c9a9b
Auto-update dependencies. [(#790)](https://github.com/GoogleCloudPlat…
dpebot Feb 9, 2017
2f0e389
Remove usage of GoogleCredentials [(#810)](https://github.com/GoogleC…
Feb 17, 2017
27611b3
Updates Could-KMS sample code to use V1 libraries. [(#856)](https://g…
philcoakley Mar 16, 2017
57dbdb1
Remove cloud config fixture [(#887)](https://github.com/GoogleCloudPl…
Apr 4, 2017
fa6ee74
Re-generate all readmes
Apr 27, 2017
966d0d9
KMS: Clean up base64 logic in the encrypt and decrypt functions. [(#1…
Aug 16, 2017
77e5c1a
KMS: Make the samples consistent with the other languages. [(#1075)](…
Aug 17, 2017
aa49dbc
Auto-update dependencies. [(#1094)](https://github.com/GoogleCloudPla…
dpebot Aug 30, 2017
04e00af
Update all generated readme auth instructions [(#1121)](https://githu…
Sep 18, 2017
5156f09
Auto-update dependencies. [(#1133)](https://github.com/GoogleCloudPla…
dpebot Sep 21, 2017
f894679
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
Oct 12, 2017
98fa815
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot Nov 1, 2017
091dbc6
Adds snippets for enabling and restoring a key version [(#1196)](http…
WalterHub Nov 7, 2017
ff973d8
Auto-update dependencies. [(#1217)](https://github.com/GoogleCloudPla…
dpebot Nov 15, 2017
b9a4c34
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
Dec 7, 2017
251d796
Auto-update dependencies. [(#1309)](https://github.com/GoogleCloudPla…
dpebot Jan 10, 2018
091bcac
Auto-update dependencies. [(#1320)](https://github.com/GoogleCloudPla…
dpebot Feb 2, 2018
c4f16b4
Auto-update dependencies. [(#1355)](https://github.com/GoogleCloudPla…
dpebot Feb 9, 2018
4f3ccbf
Auto-update dependencies. [(#1359)](https://github.com/GoogleCloudPla…
dpebot Feb 26, 2018
7264e6a
Auto-update dependencies.
dpebot Apr 2, 2018
d140516
Regenerate the README files and fix the Open in Cloud Shell link for …
Apr 7, 2018
2857b8d
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn Apr 26, 2018
cf6aa1a
Resolved conflicts.
michaelawyu Jun 29, 2018
6e26023
Merge branch 'dpebot-repositorygardener' despite flaky dataproc tests
michaelawyu Jun 29, 2018
e2c0637
added kms asymmetric samples [(#1638)](https://github.com/GoogleCloud…
daniel-sanche Aug 17, 2018
45107a0
kms text fixes [(#1647)](https://github.com/GoogleCloudPlatform/pytho…
daniel-sanche Aug 22, 2018
8cbac2e
KMS test fix [(#1690)](https://github.com/GoogleCloudPlatform/python-…
daniel-sanche Sep 7, 2018
c6ac726
KMS changes [(#1723)](https://github.com/GoogleCloudPlatform/python-d…
daniel-sanche Sep 28, 2018
2b8e5e1
KMS import comments [(#1771)](https://github.com/GoogleCloudPlatform/…
daniel-sanche Oct 25, 2018
9a7aa6c
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot Nov 20, 2018
0f27818
Auto-update dependencies. [(#1862)](https://github.com/GoogleCloudPla…
dpebot Nov 21, 2018
15d486d
KMS: Updated for new client library [(#1903)](https://github.com/Goog…
daniel-sanche Jan 7, 2019
7b25fbc
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot Feb 6, 2019
fe32c0c
Move import statements into tagged regions [(#2219)](https://github.c…
engelke Jun 13, 2019
dc0df22
Adds split updates for Firebase ... opencensus [(#2438)](https://gith…
gguuss Oct 8, 2019
18100cc
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot Dec 21, 2019
17f78cf
chore(deps): update dependency google-cloud-kms to v1.3.0 [(#3160)](h…
renovate-bot Mar 30, 2020
a4df66a
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg Apr 2, 2020
e1fe4da
[kms] fix flaky test [(#3268)](https://github.com/GoogleCloudPlatform…
daniel-sanche Apr 7, 2020
b376b7b
Update dependency google-cloud-kms to v1.4.0 [(#3410)](https://github…
renovate-bot Apr 21, 2020
5581e83
chore(deps): update dependency cryptography to v2.9 [(#3266)](https:/…
renovate-bot Apr 22, 2020
b33aa1c
fix: use `crypto_key_path` instead of `crypto_key_path_path` [(#3319)…
busunkim96 Apr 22, 2020
1e095c3
chore(deps): update dependency cryptography to v2.9.1 [(#3463)](https…
renovate-bot Apr 22, 2020
aa5277b
[kms] chore: remove gcp-devrel-py-tools [(#3479)](https://github.com/…
Apr 23, 2020
6283510
Update dependency cryptography to v2.9.2 [(#3473)](https://github.com…
renovate-bot Apr 23, 2020
2f018a3
[kms] fix: use unique ids for test [(#3563)](https://github.com/Googl…
Apr 28, 2020
97d80d5
Update and add Cloud KMS samples [(#3690)](https://github.com/GoogleC…
sethvargo May 5, 2020
1b1d5da
chore: some lint fixes [(#3748)](https://github.com/GoogleCloudPlatfo…
May 13, 2020
309319a
Merge branch 'snippets-samples' into add-snippets-samples
busunkim96 May 28, 2020
2bc9430
chore: update templates
busunkim96 May 28, 2020
515d022
chore: update templates
busunkim96 May 28, 2020
990e7a6
chore: update docs index
busunkim96 May 28, 2020
7b36aeb
chore: only trigger review for python file changes
busunkim96 Jun 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update templates
  • Loading branch information
busunkim96 committed May 28, 2020
commit 2bc94304d57bf2ff6043ceac8735d7420871979c
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ exclude =
# Exclude generated code.
**/proto/**
**/gapic/**
**/services/**
**/types/**
*_pb2.py

# Standard linting exemptions.
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
dist
build
eggs
.eggs
parts
bin
var
Expand Down Expand Up @@ -49,6 +50,7 @@ bigquery/docs/generated
# Virtual environment
env/
coverage.xml
sponge_log.xml

# System test environment variables.
system_tests/local_test_setup
Expand Down
2 changes: 0 additions & 2 deletions .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -eo pipefail

# Disable buffering, so that the logs stream through.
Expand Down
2 changes: 0 additions & 2 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/bash

set -eo pipefail

# Start the releasetool reporter
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ recursive-include google *.json *.proto
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__

# Exclude scripts for samples readmegen
prune scripts/readme-gen
17 changes: 9 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
BLACK_VERSION = "black==19.3b0"
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

if os.path.exists("samples"):
BLACK_PATHS.append("samples")
DEFAULT_PYTHON_VERSION = "3.7"
SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.7"]
UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8"]


@nox.session(python="3.7")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
"""Run linters.

Expand All @@ -56,7 +57,7 @@ def blacken(session):
session.run("black", *BLACK_PATHS)


@nox.session(python="3.7")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install("docutils", "pygments")
Expand Down Expand Up @@ -84,13 +85,13 @@ def default(session):
)


@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
def unit(session):
"""Run the unit test suite."""
default(session)


@nox.session(python=["2.7", "3.7"])
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
Expand Down Expand Up @@ -120,7 +121,7 @@ def system(session):
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)


@nox.session(python="3.7")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def cover(session):
"""Run the final coverage report.

Expand All @@ -133,7 +134,7 @@ def cover(session):
session.run("coverage", "erase")


@nox.session(python="3.7")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def docs(session):
"""Build the docs for this library."""

Expand Down
20 changes: 18 additions & 2 deletions samples/snippets/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

.. This file is automatically generated. Do not edit this file directly.

Google Cloud KMS API Python Samples
Expand All @@ -14,10 +15,12 @@ This directory contains samples for Google Cloud KMS API. The `Google Cloud KMS

.. _Google Cloud KMS API: https://cloud.google.com/kms/docs/


Setup
-------------------------------------------------------------------------------



Authentication
++++++++++++++

Expand All @@ -28,6 +31,9 @@ credentials for applications.
.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started




Install Dependencies
++++++++++++++++++++

Expand All @@ -42,7 +48,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

Expand All @@ -58,9 +64,15 @@ Install Dependencies
.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/






Samples
-------------------------------------------------------------------------------


Quickstart
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand All @@ -79,4 +91,8 @@ To run this sample:



.. _Google Cloud SDK: https://cloud.google.com/sdk/




.. _Google Cloud SDK: https://cloud.google.com/sdk/
23 changes: 7 additions & 16 deletions synth.metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
{
"updateTime": "2020-04-14T21:47:51.484475Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "2.0.0",
"dockerImage": "googleapis/artman@sha256:b3b47805231a305d0f40c4bf069df20f6a2635574e6d4259fac651d3f9f6e098"
"git": {
"name": ".",
"remote": "git@github.com:googleapis/python-kms.git",
"sha": "309319a29b3e0f851d93c58de06b60f50cf0fbfb"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "fea22b1d9f27f86ef355c1d0dba00e0791a08a19",
"internalRef": "306508794"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "52638600f387deb98efb5f9c85fec39e82aa9052"
"sha": "eafa840ceec23b44a5c21670288107c661252711",
"internalRef": "313488995"
}
}
],
Expand All @@ -31,8 +23,7 @@
"apiName": "kms",
"apiVersion": "v1",
"language": "python",
"generator": "gapic",
"config": "google/cloud/kms/artman_cloudkms.yaml"
"generator": "bazel"
}
}
]
Expand Down
9 changes: 8 additions & 1 deletion synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import synthtool as s
import synthtool.gcp as gcp
from synthtool.languages import python
import logging

logging.basicConfig(level=logging.DEBUG)
Expand Down Expand Up @@ -71,7 +72,13 @@ def crypto_key_path_path(cls, project, location, key_ring, crypto_key_path):
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(cov_level=70)
templated_files = common.py_library(cov_level=70, samples=True)
s.move(templated_files)

# ----------------------------------------------------------------------------
# Samples templates
# ----------------------------------------------------------------------------

python.py_samples()

s.shell.run(["nox", "-s", "blacken"], hide_output=False)