Skip to content

Commit

Permalink
chore: update synth.py and noxfile (#68)
Browse files Browse the repository at this point in the history
* update synth.py and noxfile

* chore: regen

* chore: set cov_level to 70

Co-authored-by: Bu Sun Kim <busunkim@google.com>
  • Loading branch information
anguillanneuf and busunkim96 committed Nov 17, 2020
1 parent 1ebaa8b commit 8c49f1f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 156 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,3 @@ system_tests/local_test_setup
# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test

# Pycharm virtual environment
venv/
2 changes: 1 addition & 1 deletion .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ubuntu:20.10
from ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

Expand Down
2 changes: 1 addition & 1 deletion .repo-metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "accessapproval",
"name": "pubsublite",
"name_pretty": "Pub/Sub Lite",
"product_documentation": "https://https://cloud.google.com/pubsub/lite",
"client_documentation": "https://googleapis.dev/python/pubsublite/latest",
Expand Down
17 changes: 4 additions & 13 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

# TODO(dpcollins-google): Improve this number to 80
MIN_COVERAGE_PERCENT = 70


@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
Expand Down Expand Up @@ -73,11 +70,9 @@ def lint_setup_py(session):

def default(session):
# Install all test dependencies, then install this package in-place.
session.install("asyncmock", "pytest-asyncio", "asynctest")
session.install("asyncmock", "pytest-asyncio")

session.install(
"mock", "pytest", "pytest-cov",
)
session.install("mock", "pytest", "pytest-cov", "asynctest")
session.install("-e", ".")

# Run py.test against the unit tests.
Expand Down Expand Up @@ -126,9 +121,7 @@ def system(session):

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install(
"mock", "pytest", "google-cloud-testutils",
)
session.install("mock", "pytest", "google-cloud-testutils", "asynctest")
session.install("-e", ".")

# Run py.test against the system tests.
Expand All @@ -146,9 +139,7 @@ def cover(session):
test runs (not system test runs), and then erases coverage data.
"""
session.install("coverage", "pytest-cov")
session.run(
"coverage", "report", "--show-missing", f"--fail-under={MIN_COVERAGE_PERCENT}",
)
session.run("coverage", "report", "--show-missing", "--fail-under=70")

session.run("coverage", "erase")

Expand Down
142 changes: 6 additions & 136 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-pubsublite.git",
"sha": "c65c3e00259389cb4471c95a864a020ced251c33"
"remote": "git@github.com:googleapis/python-pubsublite.git",
"sha": "78345176c1eaf07cd143cee941c665b3c99dbc6c"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "b1e1e0b13b580d8fb7a641978198fc8de7228b2f",
"internalRef": "341774654"
"sha": "6a69c750c3f01a69017662395f90515bbf1fe1ff",
"internalRef": "342721036"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "6542bd723403513626f61642fc02ddca528409aa"
"sha": "d5fc0bcf9ea9789c5b0e3154a9e3b29e5cea6116"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "6542bd723403513626f61642fc02ddca528409aa"
"sha": "d5fc0bcf9ea9789c5b0e3154a9e3b29e5cea6116"
}
}
],
Expand All @@ -40,135 +40,5 @@
"generator": "bazel"
}
}
],
"generatedFiles": [
".flake8",
".github/CONTRIBUTING.md",
".github/ISSUE_TEMPLATE/bug_report.md",
".github/ISSUE_TEMPLATE/feature_request.md",
".github/ISSUE_TEMPLATE/support_request.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/release-please.yml",
".github/snippet-bot.yml",
".gitignore",
".kokoro/build.sh",
".kokoro/continuous/common.cfg",
".kokoro/continuous/continuous.cfg",
".kokoro/docker/docs/Dockerfile",
".kokoro/docker/docs/fetch_gpg_keys.sh",
".kokoro/docs/common.cfg",
".kokoro/docs/docs-presubmit.cfg",
".kokoro/docs/docs.cfg",
".kokoro/populate-secrets.sh",
".kokoro/presubmit/common.cfg",
".kokoro/presubmit/presubmit.cfg",
".kokoro/publish-docs.sh",
".kokoro/release.sh",
".kokoro/release/common.cfg",
".kokoro/release/release.cfg",
".kokoro/samples/lint/common.cfg",
".kokoro/samples/lint/continuous.cfg",
".kokoro/samples/lint/periodic.cfg",
".kokoro/samples/lint/presubmit.cfg",
".kokoro/samples/python3.6/common.cfg",
".kokoro/samples/python3.6/continuous.cfg",
".kokoro/samples/python3.6/periodic.cfg",
".kokoro/samples/python3.6/presubmit.cfg",
".kokoro/samples/python3.7/common.cfg",
".kokoro/samples/python3.7/continuous.cfg",
".kokoro/samples/python3.7/periodic.cfg",
".kokoro/samples/python3.7/presubmit.cfg",
".kokoro/samples/python3.8/common.cfg",
".kokoro/samples/python3.8/continuous.cfg",
".kokoro/samples/python3.8/periodic.cfg",
".kokoro/samples/python3.8/presubmit.cfg",
".kokoro/test-samples.sh",
".kokoro/trampoline.sh",
".kokoro/trampoline_v2.sh",
".trampolinerc",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.rst",
"LICENSE",
"MANIFEST.in",
"docs/_static/custom.css",
"docs/_templates/layout.html",
"docs/conf.py",
"docs/multiprocessing.rst",
"docs/pubsublite_v1/services.rst",
"docs/pubsublite_v1/types.rst",
"google/cloud/pubsublite/py.typed",
"google/cloud/pubsublite_v1/__init__.py",
"google/cloud/pubsublite_v1/py.typed",
"google/cloud/pubsublite_v1/services/__init__.py",
"google/cloud/pubsublite_v1/services/admin_service/__init__.py",
"google/cloud/pubsublite_v1/services/admin_service/async_client.py",
"google/cloud/pubsublite_v1/services/admin_service/client.py",
"google/cloud/pubsublite_v1/services/admin_service/pagers.py",
"google/cloud/pubsublite_v1/services/admin_service/transports/__init__.py",
"google/cloud/pubsublite_v1/services/admin_service/transports/base.py",
"google/cloud/pubsublite_v1/services/admin_service/transports/grpc.py",
"google/cloud/pubsublite_v1/services/admin_service/transports/grpc_asyncio.py",
"google/cloud/pubsublite_v1/services/cursor_service/__init__.py",
"google/cloud/pubsublite_v1/services/cursor_service/async_client.py",
"google/cloud/pubsublite_v1/services/cursor_service/client.py",
"google/cloud/pubsublite_v1/services/cursor_service/pagers.py",
"google/cloud/pubsublite_v1/services/cursor_service/transports/__init__.py",
"google/cloud/pubsublite_v1/services/cursor_service/transports/base.py",
"google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py",
"google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/__init__.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/async_client.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/client.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/transports/__init__.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/transports/base.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc.py",
"google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc_asyncio.py",
"google/cloud/pubsublite_v1/services/publisher_service/__init__.py",
"google/cloud/pubsublite_v1/services/publisher_service/async_client.py",
"google/cloud/pubsublite_v1/services/publisher_service/client.py",
"google/cloud/pubsublite_v1/services/publisher_service/transports/__init__.py",
"google/cloud/pubsublite_v1/services/publisher_service/transports/base.py",
"google/cloud/pubsublite_v1/services/publisher_service/transports/grpc.py",
"google/cloud/pubsublite_v1/services/publisher_service/transports/grpc_asyncio.py",
"google/cloud/pubsublite_v1/services/subscriber_service/__init__.py",
"google/cloud/pubsublite_v1/services/subscriber_service/async_client.py",
"google/cloud/pubsublite_v1/services/subscriber_service/client.py",
"google/cloud/pubsublite_v1/services/subscriber_service/transports/__init__.py",
"google/cloud/pubsublite_v1/services/subscriber_service/transports/base.py",
"google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc.py",
"google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc_asyncio.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/__init__.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/async_client.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/client.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/transports/__init__.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/transports/base.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc.py",
"google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc_asyncio.py",
"google/cloud/pubsublite_v1/types/__init__.py",
"google/cloud/pubsublite_v1/types/admin.py",
"google/cloud/pubsublite_v1/types/common.py",
"google/cloud/pubsublite_v1/types/cursor.py",
"google/cloud/pubsublite_v1/types/publisher.py",
"google/cloud/pubsublite_v1/types/subscriber.py",
"google/cloud/pubsublite_v1/types/topic_stats.py",
"mypy.ini",
"noxfile.py",
"renovate.json",
"scripts/decrypt-secrets.sh",
"scripts/readme-gen/readme_gen.py",
"scripts/readme-gen/templates/README.tmpl.rst",
"scripts/readme-gen/templates/auth.tmpl.rst",
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
"scripts/readme-gen/templates/install_deps.tmpl.rst",
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
"setup.cfg",
"testing/.gitignore",
"tests/unit/gapic/pubsublite_v1/__init__.py",
"tests/unit/gapic/pubsublite_v1/test_admin_service.py",
"tests/unit/gapic/pubsublite_v1/test_cursor_service.py",
"tests/unit/gapic/pubsublite_v1/test_partition_assignment_service.py",
"tests/unit/gapic/pubsublite_v1/test_publisher_service.py",
"tests/unit/gapic/pubsublite_v1/test_subscriber_service.py",
"tests/unit/gapic/pubsublite_v1/test_topic_stats_service.py"
]
}
8 changes: 6 additions & 2 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
service="pubsublite",
version="v1",
bazel_target="//google/cloud/pubsublite/v1:pubsublite-v1-py",

)

excludes = [
Expand All @@ -44,7 +43,12 @@
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(cov_level=99, microgenerator=True)
templated_files = common.py_library(
cov_level=70,
microgenerator=True,
system_test_external_dependencies = ['asynctest'],
unit_test_external_dependencies = ['asynctest'],
)

s.move(
templated_files, excludes=[".coveragerc"]
Expand Down

0 comments on commit 8c49f1f

Please sign in to comment.