Skip to content

Commit

Permalink
feat: Introduce tracks and thumbnails fields for FaceDetectionAnnotat…
Browse files Browse the repository at this point in the history
…ions (GoogleCloudPlatform#90)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2e07b4d7-dfb2-4ae0-bdea-6cc5c2642547/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 346664095
Source-Link: googleapis/googleapis@468a94a
PiperOrigin-RevId: 346138329
Source-Link: googleapis/googleapis@674ec0e
Source-Link: googleapis/synthtool@7fcc405
  • Loading branch information
yoshi-automation authored and pull[bot] committed Apr 4, 2024
1 parent 6cd0446 commit f524c40
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 399 deletions.
195 changes: 0 additions & 195 deletions videointelligence/samples/analyze/README.rst

This file was deleted.

34 changes: 17 additions & 17 deletions videointelligence/samples/analyze/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,28 @@

TEST_CONFIG = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
'ignored_versions': ["2.7"],

# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
'enforce_type_hints': False,

# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
# to use your own Cloud project.
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',

# A dictionary you want to inject into your test. Don't put any
# secrets here. These values will override predefined values.
"envs": {},
'envs': {},
}


try:
# Ensure we can import noxfile_config in the project's directory.
sys.path.append(".")
sys.path.append('.')
from noxfile_config import TEST_CONFIG_OVERRIDE
except ImportError as e:
print("No user noxfile_config found: detail: {}".format(e))
Expand All @@ -70,12 +73,12 @@ def get_pytest_env_vars():
ret = {}

# Override the GCLOUD_PROJECT and the alias.
env_key = TEST_CONFIG["gcloud_project_env"]
env_key = TEST_CONFIG['gcloud_project_env']
# This should error out if not set.
ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key]
ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key]

# Apply user supplied envs.
ret.update(TEST_CONFIG["envs"])
ret.update(TEST_CONFIG['envs'])
return ret


Expand All @@ -84,7 +87,7 @@ def get_pytest_env_vars():
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']

TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS])

Expand Down Expand Up @@ -133,7 +136,7 @@ def _determine_local_import_names(start_dir):

@nox.session
def lint(session):
if not TEST_CONFIG["enforce_type_hints"]:
if not TEST_CONFIG['enforce_type_hints']:
session.install("flake8", "flake8-import-order")
else:
session.install("flake8", "flake8-import-order", "flake8-annotations")
Expand All @@ -142,11 +145,9 @@ def lint(session):
args = FLAKE8_COMMON_ARGS + [
"--application-import-names",
",".join(local_names),
".",
"."
]
session.run("flake8", *args)


#
# Black
#
Expand All @@ -159,7 +160,6 @@ def blacken(session):

session.run("black", *python_files)


#
# Sample Tests
#
Expand Down Expand Up @@ -199,9 +199,9 @@ def py(session):
if session.python in TESTED_VERSIONS:
_session_tests(session)
else:
session.skip(
"SKIPPED: {} tests are disabled for this sample.".format(session.python)
)
session.skip("SKIPPED: {} tests are disabled for this sample.".format(
session.python
))


#
Expand Down
Loading

0 comments on commit f524c40

Please sign in to comment.