diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..39ee41b --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +on: + pull_request: + branches: + - v1 +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.8" + - 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 \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..bc3bfb5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - v1 +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.8" + - 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..f93325a --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,58 @@ +on: + pull_request: + branches: + - v1 +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8'] + 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.8" + - 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=45 + diff --git a/.kokoro/release.sh b/.kokoro/release.sh index ab45f68..2973c5c 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_KEYSTORE_DIR}/73713_google_cloud_pypi_password") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-containeranalysis python3 setup.py sdist bdist_wheel -twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 56fda51..052e643 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,42 +23,18 @@ env_vars: { value: "github/python-containeranalysis/.kokoro/release.sh" } -# Fetch the token needed for reporting release status to GitHub -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - } - } -} - # Fetch PyPI password before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google_cloud_pypi_password" + keyname: "google-cloud-pypi-token-keystore-1" } } } -# Fetch magictoken to use with Magic Github Proxy -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "releasetool-magictoken" - } - } -} - -# Fetch api key to use with Magic Github Proxy -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "magic-github-proxy-api-key" - } - } +# 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" } diff --git a/CHANGELOG.md b/CHANGELOG.md index d84aec6..2d6a4c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.4](https://github.com/googleapis/python-containeranalysis/compare/v1.0.3...v1.0.4) (2022-04-04) + + +### Bug Fixes + +* **deps:** require google-api-core >= 1.31.5, >= 2.3.2 on v1 release ([#260](https://github.com/googleapis/python-containeranalysis/issues/260)) ([be6fb87](https://github.com/googleapis/python-containeranalysis/commit/be6fb87d6d3e00d798b37dc89324ca88d3da6107)) + ### [1.0.3](https://www.github.com/googleapis/python-containeranalysis/compare/v1.0.2...v1.0.3) (2020-08-11) diff --git a/docs/conf.py b/docs/conf.py index 9fb6f92..5cadbc3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -66,9 +66,9 @@ master_doc = "index" # General information about the project. -project = u"google-cloud-containeranalysis" -copyright = u"2019, Google" -author = u"Google APIs" +project = "google-cloud-containeranalysis" +copyright = "2019, Google" +author = "Google APIs" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -267,7 +267,7 @@ ( master_doc, "google-cloud-containeranalysis.tex", - u"google-cloud-containeranalysis Documentation", + "google-cloud-containeranalysis Documentation", author, "manual", ) @@ -302,7 +302,7 @@ ( master_doc, "google-cloud-containeranalysis", - u"google-cloud-containeranalysis Documentation", + "google-cloud-containeranalysis Documentation", [author], 1, ) @@ -321,7 +321,7 @@ ( master_doc, "google-cloud-containeranalysis", - u"google-cloud-containeranalysis Documentation", + "google-cloud-containeranalysis Documentation", author, "google-cloud-containeranalysis", "google-cloud-containeranalysis Library", @@ -346,7 +346,10 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.io/grpc/python/", None), } diff --git a/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py b/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py index e03791b..6475aa5 100644 --- a/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py +++ b/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py @@ -179,8 +179,12 @@ def __init__( ) self.transport = transport else: - self.transport = container_analysis_grpc_transport.ContainerAnalysisGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials, + self.transport = ( + container_analysis_grpc_transport.ContainerAnalysisGrpcTransport( + address=api_endpoint, + channel=channel, + credentials=credentials, + ) ) if client_info is None: @@ -289,7 +293,10 @@ def set_iam_policy( client_info=self._client_info, ) - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy,) + request = iam_policy_pb2.SetIamPolicyRequest( + resource=resource, + policy=policy, + ) if metadata is None: metadata = [] metadata = list(metadata) @@ -374,7 +381,8 @@ def get_iam_policy( ) request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_, + resource=resource, + options=options_, ) if metadata is None: metadata = [] @@ -461,7 +469,8 @@ def test_iam_permissions( ) request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions, + resource=resource, + permissions=permissions, ) if metadata is None: metadata = [] diff --git a/noxfile.py b/noxfile.py index fcfde61..a90f834 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,7 +23,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -40,12 +40,14 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") -@nox.session(python="3.6") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): """Run black. @@ -57,7 +59,8 @@ def blacken(session): """ session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) @@ -120,7 +123,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. session.install( - "mock", "pytest", "google-cloud-testutils", + "mock", + "pytest", + "google-cloud-testutils", ) session.install("-e", ".") @@ -149,7 +154,7 @@ def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx<3.0.0", "alabaster", "recommonmark") + session.install("sphinx<3.0.0", "alabaster", "recommonmark", "Jinja2<3.1") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( @@ -171,7 +176,13 @@ def docfx(session): """Build the docfx yaml files for this library.""" session.install("-e", ".") - session.install("sphinx<3.0.0", "alabaster", "recommonmark", "sphinx-docfx-yaml") + session.install( + "sphinx<3.0.0", + "alabaster", + "recommonmark", + "gcp-sphinx-docfx-yaml", + "Jinja2<3.1", + ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( diff --git a/setup.py b/setup.py index 3899f26..4ea8ae4 100644 --- a/setup.py +++ b/setup.py @@ -22,10 +22,10 @@ name = "google-cloud-containeranalysis" description = "Container Analysis API API client library" -version = "1.0.3" +version = "1.0.4" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", + "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", 'enum34; python_version < "3.4"', "grafeas < 1.0.0dev",