diff --git a/.flake8 b/.flake8 index 29227d4..2e43874 100644 --- a/.flake8 +++ b/.flake8 @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E231, E266, E501, W503 exclude = # Exclude generated code. **/proto/** diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 0000000..41bff0b --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,15 @@ +# 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. +requestsize: + enabled: true diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e..6def37a 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,8 @@ releaseType: python handleGHRelease: true +# NOTE: this section is generated by synthtool.languages.python +# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py +branches: +- branch: v0 + handleGHRelease: true + releaseType: python diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb..238b87b 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62eb5a7..46d2371 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de7bbf..cbfc0dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog -### [1.1.1](https://github.com/googleapis/python-appengine-logging/compare/v1.1.0...v1.1.1) (2022-03-05) +## [1.1.2](https://github.com/googleapis/python-appengine-logging/compare/v1.1.1...v1.1.2) (2022-06-03) + + +### Bug Fixes + +* **deps:** require protobuf <4.0.0dev ([#95](https://github.com/googleapis/python-appengine-logging/issues/95)) ([ad0bcd2](https://github.com/googleapis/python-appengine-logging/commit/ad0bcd219d1d5d976529d49ef8ade36fde7e32ce)) + + +### Documentation + +* fix changelog header to consistent size ([#96](https://github.com/googleapis/python-appengine-logging/issues/96)) ([4c01656](https://github.com/googleapis/python-appengine-logging/commit/4c016568df4a5abc145daae1ae4448535181f4ff)) + +## [1.1.1](https://github.com/googleapis/python-appengine-logging/compare/v1.1.0...v1.1.1) (2022-03-05) ### Bug Fixes @@ -28,14 +40,14 @@ * add context manager support in client ([#44](https://www.github.com/googleapis/python-appengine-logging/issues/44)) ([9d23c02](https://www.github.com/googleapis/python-appengine-logging/commit/9d23c02d043cf4c569e445eb13db5f78207fbaa7)) -### [0.1.5](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.4...v0.1.5) (2021-09-24) +## [0.1.5](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.4...v0.1.5) (2021-09-24) ### Bug Fixes * add 'dict' annotation type to 'request' ([35fa951](https://www.github.com/googleapis/python-appengine-logging/commit/35fa951f775931caefacf0b7dadd37610aad9354)) -### [0.1.4](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.3...v0.1.4) (2021-07-29) +## [0.1.4](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.3...v0.1.4) (2021-07-29) ### Documentation @@ -47,21 +59,21 @@ * release as 0.1.4 ([#24](https://www.github.com/googleapis/python-appengine-logging/issues/24)) ([5aa924e](https://www.github.com/googleapis/python-appengine-logging/commit/5aa924e0a24a94cf259168cc1dd5aa65dc0f40a9)) -### [0.1.3](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.2...v0.1.3) (2021-07-21) +## [0.1.3](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.2...v0.1.3) (2021-07-21) ### Bug Fixes * **deps:** pin 'google-{api,cloud}-core', 'google-auth' to allow 2.x versions ([#18](https://www.github.com/googleapis/python-appengine-logging/issues/18)) ([6f49270](https://www.github.com/googleapis/python-appengine-logging/commit/6f492709a55926c7b993da7bb26469fc0bf79128)) -### [0.1.2](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.1...v0.1.2) (2021-07-14) +## [0.1.2](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.1...v0.1.2) (2021-07-14) ### Documentation * omit mention of Python 2.7 in 'CONTRIBUTING.rst' ([#1127](https://www.github.com/googleapis/python-appengine-logging/issues/1127)) ([#8](https://www.github.com/googleapis/python-appengine-logging/issues/8)) ([f1bd0a3](https://www.github.com/googleapis/python-appengine-logging/commit/f1bd0a3d2d068fae0c6d9c167a25908b6f808997)), closes [#1126](https://www.github.com/googleapis/python-appengine-logging/issues/1126) -### [0.1.1](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.0...v0.1.1) (2021-06-16) +## [0.1.1](https://www.github.com/googleapis/python-appengine-logging/compare/v0.1.0...v0.1.1) (2021-06-16) ### Bug Fixes diff --git a/docs/conf.py b/docs/conf.py index 070404e..a2e84d6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -361,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", 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.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), diff --git a/google/cloud/appengine_logging/__init__.py b/google/cloud/appengine_logging/__init__.py index ee2818e..f5cb6cc 100644 --- a/google/cloud/appengine_logging/__init__.py +++ b/google/cloud/appengine_logging/__init__.py @@ -15,10 +15,12 @@ # -from google.cloud.appengine_logging_v1.types.request_log import LogLine -from google.cloud.appengine_logging_v1.types.request_log import RequestLog -from google.cloud.appengine_logging_v1.types.request_log import SourceLocation -from google.cloud.appengine_logging_v1.types.request_log import SourceReference +from google.cloud.appengine_logging_v1.types.request_log import ( + LogLine, + RequestLog, + SourceLocation, + SourceReference, +) __all__ = ( "LogLine", diff --git a/google/cloud/appengine_logging_v1/__init__.py b/google/cloud/appengine_logging_v1/__init__.py index db01b11..1acb51d 100644 --- a/google/cloud/appengine_logging_v1/__init__.py +++ b/google/cloud/appengine_logging_v1/__init__.py @@ -15,10 +15,7 @@ # -from .types.request_log import LogLine -from .types.request_log import RequestLog -from .types.request_log import SourceLocation -from .types.request_log import SourceReference +from .types.request_log import LogLine, RequestLog, SourceLocation, SourceReference __all__ = ( "LogLine", diff --git a/google/cloud/appengine_logging_v1/types/__init__.py b/google/cloud/appengine_logging_v1/types/__init__.py index 6f03b6e..02719c9 100644 --- a/google/cloud/appengine_logging_v1/types/__init__.py +++ b/google/cloud/appengine_logging_v1/types/__init__.py @@ -13,12 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .request_log import ( - LogLine, - RequestLog, - SourceLocation, - SourceReference, -) +from .request_log import LogLine, RequestLog, SourceLocation, SourceReference __all__ = ( "LogLine", diff --git a/google/cloud/appengine_logging_v1/types/request_log.py b/google/cloud/appengine_logging_v1/types/request_log.py index 2982d16..c3fb22d 100644 --- a/google/cloud/appengine_logging_v1/types/request_log.py +++ b/google/cloud/appengine_logging_v1/types/request_log.py @@ -13,16 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.logging.type import log_severity_pb2 # type: ignore from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.appengine.logging.v1", - manifest={"LogLine", "SourceLocation", "SourceReference", "RequestLog",}, + manifest={ + "LogLine", + "SourceLocation", + "SourceReference", + "RequestLog", + }, ) @@ -42,10 +45,25 @@ class LogLine(proto.Message): written. """ - time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - severity = proto.Field(proto.ENUM, number=2, enum=log_severity_pb2.LogSeverity,) - log_message = proto.Field(proto.STRING, number=3,) - source_location = proto.Field(proto.MESSAGE, number=4, message="SourceLocation",) + time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + severity = proto.Field( + proto.ENUM, + number=2, + enum=log_severity_pb2.LogSeverity, + ) + log_message = proto.Field( + proto.STRING, + number=3, + ) + source_location = proto.Field( + proto.MESSAGE, + number=4, + message="SourceLocation", + ) class SourceLocation(proto.Message): @@ -68,9 +86,18 @@ class SourceLocation(proto.Message): (Go), ``function`` (Python). """ - file = proto.Field(proto.STRING, number=1,) - line = proto.Field(proto.INT64, number=2,) - function_name = proto.Field(proto.STRING, number=3,) + file = proto.Field( + proto.STRING, + number=1, + ) + line = proto.Field( + proto.INT64, + number=2, + ) + function_name = proto.Field( + proto.STRING, + number=3, + ) class SourceReference(proto.Message): @@ -88,8 +115,14 @@ class SourceReference(proto.Message): "0035781c50ec7aa23385dc841529ce8a4b70db1b". """ - repository = proto.Field(proto.STRING, number=1,) - revision_id = proto.Field(proto.STRING, number=2,) + repository = proto.Field( + proto.STRING, + number=1, + ) + revision_id = proto.Field( + proto.STRING, + number=2, + ) class RequestLog(proto.Message): @@ -205,40 +238,143 @@ class RequestLog(proto.Message): code is distributed among multiple repositories. """ - app_id = proto.Field(proto.STRING, number=1,) - module_id = proto.Field(proto.STRING, number=37,) - version_id = proto.Field(proto.STRING, number=2,) - request_id = proto.Field(proto.STRING, number=3,) - ip = proto.Field(proto.STRING, number=4,) - start_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) - end_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) - latency = proto.Field(proto.MESSAGE, number=8, message=duration_pb2.Duration,) - mega_cycles = proto.Field(proto.INT64, number=9,) - method = proto.Field(proto.STRING, number=10,) - resource = proto.Field(proto.STRING, number=11,) - http_version = proto.Field(proto.STRING, number=12,) - status = proto.Field(proto.INT32, number=13,) - response_size = proto.Field(proto.INT64, number=14,) - referrer = proto.Field(proto.STRING, number=15,) - user_agent = proto.Field(proto.STRING, number=16,) - nickname = proto.Field(proto.STRING, number=40,) - url_map_entry = proto.Field(proto.STRING, number=17,) - host = proto.Field(proto.STRING, number=20,) - cost = proto.Field(proto.DOUBLE, number=21,) - task_queue_name = proto.Field(proto.STRING, number=22,) - task_name = proto.Field(proto.STRING, number=23,) - was_loading_request = proto.Field(proto.BOOL, number=24,) - pending_time = proto.Field(proto.MESSAGE, number=25, message=duration_pb2.Duration,) - instance_index = proto.Field(proto.INT32, number=26,) - finished = proto.Field(proto.BOOL, number=27,) - first = proto.Field(proto.BOOL, number=42,) - instance_id = proto.Field(proto.STRING, number=28,) - line = proto.RepeatedField(proto.MESSAGE, number=29, message="LogLine",) - app_engine_release = proto.Field(proto.STRING, number=38,) - trace_id = proto.Field(proto.STRING, number=39,) - trace_sampled = proto.Field(proto.BOOL, number=43,) + app_id = proto.Field( + proto.STRING, + number=1, + ) + module_id = proto.Field( + proto.STRING, + number=37, + ) + version_id = proto.Field( + proto.STRING, + number=2, + ) + request_id = proto.Field( + proto.STRING, + number=3, + ) + ip = proto.Field( + proto.STRING, + number=4, + ) + start_time = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + end_time = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + latency = proto.Field( + proto.MESSAGE, + number=8, + message=duration_pb2.Duration, + ) + mega_cycles = proto.Field( + proto.INT64, + number=9, + ) + method = proto.Field( + proto.STRING, + number=10, + ) + resource = proto.Field( + proto.STRING, + number=11, + ) + http_version = proto.Field( + proto.STRING, + number=12, + ) + status = proto.Field( + proto.INT32, + number=13, + ) + response_size = proto.Field( + proto.INT64, + number=14, + ) + referrer = proto.Field( + proto.STRING, + number=15, + ) + user_agent = proto.Field( + proto.STRING, + number=16, + ) + nickname = proto.Field( + proto.STRING, + number=40, + ) + url_map_entry = proto.Field( + proto.STRING, + number=17, + ) + host = proto.Field( + proto.STRING, + number=20, + ) + cost = proto.Field( + proto.DOUBLE, + number=21, + ) + task_queue_name = proto.Field( + proto.STRING, + number=22, + ) + task_name = proto.Field( + proto.STRING, + number=23, + ) + was_loading_request = proto.Field( + proto.BOOL, + number=24, + ) + pending_time = proto.Field( + proto.MESSAGE, + number=25, + message=duration_pb2.Duration, + ) + instance_index = proto.Field( + proto.INT32, + number=26, + ) + finished = proto.Field( + proto.BOOL, + number=27, + ) + first = proto.Field( + proto.BOOL, + number=42, + ) + instance_id = proto.Field( + proto.STRING, + number=28, + ) + line = proto.RepeatedField( + proto.MESSAGE, + number=29, + message="LogLine", + ) + app_engine_release = proto.Field( + proto.STRING, + number=38, + ) + trace_id = proto.Field( + proto.STRING, + number=39, + ) + trace_sampled = proto.Field( + proto.BOOL, + number=43, + ) source_reference = proto.RepeatedField( - proto.MESSAGE, number=41, message="SourceReference", + proto.MESSAGE, + number=41, + message="SourceReference", ) diff --git a/noxfile.py b/noxfile.py index 2a2001c..7c1742d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,19 +17,45 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil +import warnings import nox - -BLACK_VERSION = "black==19.10b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +BLACK_VERSION = "black==22.3.0" +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES = [] +UNIT_TEST_LOCAL_DEPENDENCIES = [] +UNIT_TEST_DEPENDENCIES = [] +UNIT_TEST_EXTRAS = [] +UNIT_TEST_EXTRAS_BY_PYTHON = {} + +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES = [] +SYSTEM_TEST_DEPENDENCIES = [] +SYSTEM_TEST_EXTRAS = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -57,7 +83,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +95,28 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) @@ -78,23 +127,41 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") +def install_unittest_dependencies(session, *constraints): + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, *constraints) + + if UNIT_TEST_EXTERNAL_DEPENDENCIES: + warnings.warn( + "'unit_test_external_dependencies' is deprecated. Instead, please " + "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.", + DeprecationWarning, + ) + session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_LOCAL_DEPENDENCIES: + session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_EXTRAS_BY_PYTHON: + extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif UNIT_TEST_EXTRAS: + extras = UNIT_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + def default(session): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install( - "mock", - "asyncmock", - "pytest", - "pytest-cov", - "pytest-asyncio", - "-c", - constraints_path, - ) - - session.install("-e", ".", "-c", constraints_path) + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -118,6 +185,35 @@ def unit(session): default(session) +def install_systemtest_dependencies(session, *constraints): + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTERNAL_DEPENDENCIES: + session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_LOCAL_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTRAS_BY_PYTHON: + extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif SYSTEM_TEST_EXTRAS: + extras = SYSTEM_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" @@ -140,13 +236,7 @@ def system(session): if not system_test_exists and not system_test_folder_exists: session.skip("System tests were not found") - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + install_systemtest_dependencies(session, "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') diff --git a/setup.py b/setup.py index 769349d..89729ec 100644 --- a/setup.py +++ b/setup.py @@ -15,9 +15,10 @@ # import io import os + import setuptools # type: ignore -version = "1.1.1" +version = "1.1.2" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -46,8 +47,8 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "proto-plus >= 1.15.0", - "packaging >= 14.3", + "proto-plus >= 1.15.0, <2.0.0dev", + "protobuf >= 3.19.0, <4.0.0dev", ), python_requires=">=3.6", classifiers=[ diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 766f288..ec8ca20 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -7,4 +7,4 @@ # Then this file should have foo==1.14.0 google-api-core==1.31.5 proto-plus==1.15.0 -packaging==14.3 +protobuf==3.19.0 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index e69de29..ec8ca20 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# 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.31.5 +proto-plus==1.15.0 +protobuf==3.19.0