-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for
google.cloud.artifactregistry.__version__
(#199)
* chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud.<api>.__version__` PiperOrigin-RevId: 484665853 Source-Link: googleapis/googleapis@8eb249a Source-Link: googleapis/googleapis-gen@c8aa327 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * add owlbot.py to exclude generated gapic_version.py * set manifest to true in .github/release-please.yml * add release-please-config.json * use autogenerated setup.py * add replacement to fix testing/constraints-3.7.txt Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
- Loading branch information
1 parent
fb4f601
commit 5f650ea
Showing
18 changed files
with
212 additions
and
47 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/google-cloud-artifact-registry/.github/release-please.yml
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
3 changes: 3 additions & 0 deletions
3
packages/google-cloud-artifact-registry/.release-please-manifest.json
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,3 @@ | ||
{ | ||
".": "1.3.3" | ||
} |
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
16 changes: 16 additions & 0 deletions
16
packages/google-cloud-artifact-registry/google/cloud/artifactregistry/gapic_version.py
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,16 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2022 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. | ||
# | ||
__version__ = "1.3.3" # {x-release-please-version} |
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
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,65 @@ | ||
# Copyright 2022 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. | ||
|
||
import json | ||
from pathlib import Path | ||
import shutil | ||
|
||
import synthtool as s | ||
import synthtool.gcp as gcp | ||
from synthtool.languages import python | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Copy the generated client from the owl-bot staging directory | ||
# ---------------------------------------------------------------------------- | ||
|
||
clean_up_generated_samples = True | ||
|
||
# Load the default version defined in .repo-metadata.json. | ||
default_version = json.load(open(".repo-metadata.json", "rt")).get( | ||
"default_version" | ||
) | ||
|
||
for library in s.get_staging_dirs(default_version): | ||
if clean_up_generated_samples: | ||
shutil.rmtree("samples/generated_samples", ignore_errors=True) | ||
clean_up_generated_samples = False | ||
|
||
# remove replacement once a new gapic-generator-python version is released | ||
# which includes this fix https://github.com/googleapis/gapic-generator-python/pull/1483 | ||
s.replace( | ||
library / "testing/constraints-3.7.txt", | ||
"grpc-google-iam-v1=0", | ||
"grpc-google-iam-v1==0", | ||
) | ||
|
||
s.move([library], excludes=["**/gapic_version.py"]) | ||
s.remove_staging_dirs() | ||
|
||
# ---------------------------------------------------------------------------- | ||
# Add templated files | ||
# ---------------------------------------------------------------------------- | ||
|
||
templated_files = gcp.CommonTemplates().py_library( | ||
cov_level=100, | ||
microgenerator=True, | ||
versions=gcp.common.detect_versions(path="./google", default_first=True), | ||
) | ||
s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"]) | ||
|
||
python.py_samples(skip_readmes=True) | ||
|
||
# run format session for all directories which have a noxfile | ||
for noxfile in Path(".").glob("**/noxfile.py"): | ||
s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) |
28 changes: 28 additions & 0 deletions
28
packages/google-cloud-artifact-registry/release-please-config.json
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,28 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
"packages": { | ||
".": { | ||
"release-type": "python", | ||
"extra-files": [ | ||
"google/cloud/artifactregistry/gapic_version.py", | ||
{ | ||
"type": "json", | ||
"path": "samples/generated_samples/snippet_metadata_artifactregistry_v1.json", | ||
"jsonpath": "$.clientLibrary.version" | ||
}, | ||
{ | ||
"type": "json", | ||
"path": "samples/generated_samples/snippet_metadata_artifactregistry_v1beta2.json", | ||
"jsonpath": "$.clientLibrary.version" | ||
} | ||
] | ||
} | ||
}, | ||
"release-type": "python", | ||
"plugins": [ | ||
{ | ||
"type": "sentence-case" | ||
} | ||
], | ||
"initial-version": "0.1.0" | ||
} |
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,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# This constraints file is required for unit tests. | ||
# List all library dependencies and extras in this file. | ||
google-api-core | ||
proto-plus | ||
protobuf | ||
grpc-google-iam-v1 |
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,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# This constraints file is required for unit tests. | ||
# List all library dependencies and extras in this file. | ||
google-api-core | ||
proto-plus | ||
protobuf | ||
grpc-google-iam-v1 |
27 changes: 7 additions & 20 deletions
27
packages/google-cloud-artifact-registry/testing/constraints-3.7.txt
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 |
---|---|---|
@@ -1,25 +1,12 @@ | ||
# Copyright 2021 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. | ||
# | ||
# This constraints file is used to check that lower bounds | ||
# are correct in setup.py | ||
# List *all* library dependencies and extras in this file. | ||
# List all library dependencies and extras in this file. | ||
# Pin the version to the lower bound. | ||
# | ||
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", | ||
# Then this file should have foo==1.14.0 | ||
google-api-core==1.32.0 | ||
grpc-google-iam-v1==0.12.4 | ||
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", | ||
# Then this file should have google-cloud-foo==1.14.0 | ||
# This file is intentionally left empty to test the | ||
# latest versions of dependencies. | ||
google-api-core==1.33.2 | ||
proto-plus==1.22.0 | ||
protobuf==3.19.5 | ||
grpc-google-iam-v1==0.12.4 |
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,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# This constraints file is required for unit tests. | ||
# List all library dependencies and extras in this file. | ||
google-api-core | ||
proto-plus | ||
protobuf | ||
grpc-google-iam-v1 |
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,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# This constraints file is required for unit tests. | ||
# List all library dependencies and extras in this file. | ||
google-api-core | ||
proto-plus | ||
protobuf | ||
grpc-google-iam-v1 |
Oops, something went wrong.