diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 108063d..44c78f7 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,16 @@ +# 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. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4ee57a76a176ede9087c14330c625a71553cf9c72828b2c0ca12f5338171ba60 + digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d08d984..e446644 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,9 +3,10 @@ # # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax +# Note: This file is autogenerated. To make changes to the codeowner team, please update .repo-metadata.json. -# The @googleapis/yoshi-python is the default owner for changes in this repo -* @googleapis/yoshi-python +# @googleapis/yoshi-python is the default owner for changes in this repo +* @googleapis/yoshi-python - -/samples/ @googleapis/python-samples-owners \ No newline at end of file +# @googleapis/python-samples-reviewers is the default owner for samples changes +/samples/ @googleapis/python-samples-reviewers diff --git a/.github/release-please.yml b/.github/release-please.yml index 4507ad0..466597e 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ releaseType: python +handleGHRelease: true diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 0000000..d4ca941 --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..b46d730 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +on: + pull_request: + branches: + - main +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs + docfx: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docfx + run: | + nox -s docfx diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..f512a49 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - main +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..e5be6ed --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - main +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8', '3.9', '3.10'] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ matrix.python }} + run: | + nox -s unit-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-${{ matrix.python }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=100 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 79a0123..b133a01 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-source-context python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 04a4d7b..54ed471 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,8 +23,18 @@ env_vars: { value: "github/python-source-context/.kokoro/release.sh" } +# Fetch PyPI password +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-pypi-token-keystore-1" + } + } +} + # Tokens needed to report release status back to GitHub env_vars: { key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } diff --git a/.repo-metadata.json b/.repo-metadata.json index 29064e0..6370917 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,14 +1,15 @@ { "name": "source", "name_pretty": "Source Context", - "client_documentation": "https://googleapis.dev/python/source/latest", + "client_documentation": "https://cloud.google.com/python/docs/reference/source/latest", "issue_tracker": "http://github.com/googleapis/python-source-context/issues", - "release_level": "ga", + "release_level": "stable", "language": "python", "library_type": "GAPIC_AUTO", "repo": "googleapis/python-source-context", "distribution_name": "google-cloud-source-context", "api_id": "source.googleapis.com", "default_version": "v1", - "codeowner_team": "" + "codeowner_team": "", + "api_shortname": "source" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 469b850..b50a6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.2.2](https://github.com/googleapis/python-source-context/compare/v1.2.1...v1.2.2) (2022-03-05) + + +### Bug Fixes + +* **deps:** require google-api-core>=1.31.5, >=2.3.2 ([#66](https://github.com/googleapis/python-source-context/issues/66)) ([0b06641](https://github.com/googleapis/python-source-context/commit/0b06641e0a648bdebf1539eaf12f666845795b80)) + ### [1.2.1](https://www.github.com/googleapis/python-source-context/compare/v1.2.0...v1.2.1) (2021-11-01) diff --git a/README.rst b/README.rst index c67f383..469858c 100644 --- a/README.rst +++ b/README.rst @@ -13,7 +13,7 @@ This package contains generated Python types for `google.cloud.source_context_v1 :target: https://pypi.org/project/google-cloud-source-context/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-source-context.svg :target: https://pypi.org/project/google-cloud-source-context/ -.. _Client Library Documentation: https://googleapis.dev/python/source/latest +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/source/latest Installation ------------ diff --git a/google/cloud/source_context/__init__.py b/google/cloud/source_context/__init__.py index bafa1b4..3d3e9a0 100644 --- a/google/cloud/source_context/__init__.py +++ b/google/cloud/source_context/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/google/cloud/source_context_v1/__init__.py b/google/cloud/source_context_v1/__init__.py index 3db56f6..d57f6a5 100644 --- a/google/cloud/source_context_v1/__init__.py +++ b/google/cloud/source_context_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/google/cloud/source_context_v1/services/__init__.py b/google/cloud/source_context_v1/services/__init__.py index 4de6597..e8e1c38 100644 --- a/google/cloud/source_context_v1/services/__init__.py +++ b/google/cloud/source_context_v1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/google/cloud/source_context_v1/types/__init__.py b/google/cloud/source_context_v1/types/__init__.py index 2fa5567..b787d1a 100644 --- a/google/cloud/source_context_v1/types/__init__.py +++ b/google/cloud/source_context_v1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/google/cloud/source_context_v1/types/source_context.py b/google/cloud/source_context_v1/types/source_context.py index 7edbc9c..42523d4 100644 --- a/google/cloud/source_context_v1/types/source_context.py +++ b/google/cloud/source_context_v1/types/source_context.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. @@ -49,18 +49,22 @@ class SourceContext(proto.Message): cloud_repo (google.cloud.source_context_v1.types.CloudRepoSourceContext): A SourceContext referring to a revision in a cloud repo. + This field is a member of `oneof`_ ``context``. cloud_workspace (google.cloud.source_context_v1.types.CloudWorkspaceSourceContext): A SourceContext referring to a snapshot in a cloud workspace. + This field is a member of `oneof`_ ``context``. gerrit (google.cloud.source_context_v1.types.GerritSourceContext): A SourceContext referring to a Gerrit project. + This field is a member of `oneof`_ ``context``. git (google.cloud.source_context_v1.types.GitSourceContext): A SourceContext referring to any third party Git repo (e.g. GitHub). + This field is a member of `oneof`_ ``context``. """ @@ -130,12 +134,15 @@ class CloudRepoSourceContext(proto.Message): The ID of the repo. revision_id (str): A revision ID. + This field is a member of `oneof`_ ``revision``. alias_name (str): The name of an alias (branch, tag, etc.). + This field is a member of `oneof`_ ``revision``. alias_context (google.cloud.source_context_v1.types.AliasContext): An alias, which may be a branch or tag. + This field is a member of `oneof`_ ``revision``. """ @@ -183,12 +190,15 @@ class GerritSourceContext(proto.Message): hostURI/project. revision_id (str): A revision (commit) ID. + This field is a member of `oneof`_ ``revision``. alias_name (str): The name of an alias (branch, tag, etc.). + This field is a member of `oneof`_ ``revision``. alias_context (google.cloud.source_context_v1.types.AliasContext): An alias, which may be a branch or tag. + This field is a member of `oneof`_ ``revision``. """ @@ -231,10 +241,12 @@ class RepoId(proto.Message): project_repo_id (google.cloud.source_context_v1.types.ProjectRepoId): A combination of a project ID and a repo name. + This field is a member of `oneof`_ ``id``. uid (str): A server-assigned, globally unique identifier. + This field is a member of `oneof`_ ``id``. """ diff --git a/scripts/fixup_source_context_v1_keywords.py b/scripts/fixup_source_context_v1_keywords.py index 218cb42..a1b26cb 100644 --- a/scripts/fixup_source_context_v1_keywords.py +++ b/scripts/fixup_source_context_v1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/setup.py b/setup.py index 51b14f8..3d7cbc8 100644 --- a/setup.py +++ b/setup.py @@ -22,14 +22,14 @@ name = "google-cloud-source-context" description = "Python client for Source Context" -version = "1.2.1" +version = "1.2.2" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-source-context" dependencies = [ # NOTE: Maintainers, please do not require google-api-core>=2.x.x # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 - "google-api-core[grpc] >= 1.28.0, <3.0.0dev", + "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", "proto-plus >= 1.15.0", ] diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 1e3ec8b..be5a64f 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -4,5 +4,5 @@ # Pin the version to the lower bound. # 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 -google-api-core==1.28.0 +google-api-core==1.31.5 proto-plus==1.15.0 diff --git a/tests/__init__.py b/tests/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/tests/unit/gapic/__init__.py b/tests/unit/gapic/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/unit/gapic/__init__.py +++ b/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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. diff --git a/tests/unit/gapic/source_context_v1/__init__.py b/tests/unit/gapic/source_context_v1/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/unit/gapic/source_context_v1/__init__.py +++ b/tests/unit/gapic/source_context_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# 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.