Skip to content

Commit

Permalink
chore(python): run blacken session for all directories with a noxfile (
Browse files Browse the repository at this point in the history
…#180)

Source-Link: googleapis/synthtool@bc0de6e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:39ad8c0570e4f5d2d3124a509de4fe975e799e2b97e0f58aed88f8880d5a8b60

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 11, 2021
1 parent 72dbf67 commit e1560d3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions talent/job_search_batch_update_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def batch_update_jobs(
description=description_one,
application_info=application_info,
addresses=addresses,
language_code=language_code_one
language_code=language_code_one,
)

uris_2 = [job_application_url_two]
Expand All @@ -129,7 +129,7 @@ def batch_update_jobs(
description=description_two,
application_info=application_info_2,
addresses=addresses_2,
language_code=language_code_two
language_code=language_code_two,
)

jobs = [jobs_element, jobs_element_2]
Expand Down
8 changes: 2 additions & 6 deletions talent/job_search_commute_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def search_jobs(project_id, tenant_id):
session_id = "Hashed session identifier"
user_id = "Hashed user identifier"
request_metadata = talent.RequestMetadata(
domain=domain,
session_id=session_id,
user_id=user_id
domain=domain, session_id=session_id, user_id=user_id
)
commute_method = talent.CommuteMethod.TRANSIT
seconds = 1800
Expand All @@ -55,9 +53,7 @@ def search_jobs(project_id, tenant_id):
# Iterate over all results
results = []
request = talent.SearchJobsRequest(
parent=parent,
request_metadata=request_metadata,
job_query=job_query,
parent=parent, request_metadata=request_metadata, job_query=job_query,
)
for response_item in client.search_jobs(request=request).matching_jobs:
print(f"Job summary: {response_item.job_summary}")
Expand Down
2 changes: 1 addition & 1 deletion talent/job_search_create_job_custom_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def create_job(project_id, tenant_id, company_id, requisition_id):
requisition_id=requisition_id,
description="This is a description of this job",
language_code="en-us",
custom_attributes={"FOR_STUDENTS": custom_attribute}
custom_attributes={"FOR_STUDENTS": custom_attribute},
)

response = client.create_job(parent=parent, job=job)
Expand Down
10 changes: 5 additions & 5 deletions talent/job_search_custom_ranking_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def search_jobs(project_id, tenant_id):
session_id = "Hashed session identifier"
user_id = "Hashed user identifier"
request_metadata = talent.RequestMetadata(
domain=domain,
session_id=session_id,
user_id=user_id
domain=domain, session_id=session_id, user_id=user_id
)
importance_level = (
talent.SearchJobsRequest.CustomRankingInfo.ImportanceLevel.EXTREME
)
importance_level = talent.SearchJobsRequest.CustomRankingInfo.ImportanceLevel.EXTREME
ranking_expression = "(someFieldLong + 25) * 0.25"
custom_ranking_info = {
"importance_level": importance_level,
Expand All @@ -53,7 +53,7 @@ def search_jobs(project_id, tenant_id):
parent=parent,
request_metadata=request_metadata,
custom_ranking_info=custom_ranking_info,
order_by=order_by
order_by=order_by,
)
for response_item in client.search_jobs(request=request).matching_jobs:
print(f"Job summary: {response_item.job_summary}")
Expand Down
2 changes: 1 addition & 1 deletion talent/job_search_list_tenants_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@pytest.fixture(scope="module")
def test_tenant():
client = talent.TenantServiceClient()
external_id = f'test_tenant_{uuid.uuid4().hex}'
external_id = f"test_tenant_{uuid.uuid4().hex}"
parent = f"projects/{PROJECT_ID}"
tenant = {"external_id": external_id}
resp = client.create_tenant(parent=parent, tenant=tenant)
Expand Down
8 changes: 3 additions & 5 deletions talent/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@

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

"ignored_versions": ["2.7"],
# 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': 'BUILD_SPECIFIC_GCLOUD_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": {},
}

0 comments on commit e1560d3

Please sign in to comment.