Skip to content

Commit fd2965c

Browse files
chore: release 2.16.0 (#1473)
🤖 I have created a release \*beep\* \*boop\* --- ## [2.16.0](https://www.github.com/googleapis/google-api-python-client/compare/v2.15.0...v2.16.0) (2021-08-10) ### Features * **accesscontextmanager:** update the api 30216a6 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **alertcenter:** update the api 39b0847 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **androidpublisher:** update the api cf67afc ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **apigee:** update the api 4485c5f ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **apigee:** update the api 9953369 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **appengine:** update the api eb7a571 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **bigquery:** update the api 304bbde ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **chromemanagement:** update the api 0ba28b4 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **chromepolicy:** update the api 5654776 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **cloudasset:** update the api 792aa55 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **cloudbuild:** update the api 437e37f ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **cloudbuild:** update the api 6b06387 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **cloudchannel:** update the api 0b0444e ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **cloudkms:** update the api 7dc2784 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **cloudkms:** update the api ebd3f49 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **composer:** update the api 92131bf ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **containeranalysis:** update the api 9ab94f3 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **containeranalysis:** update the api d446928 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **container:** update the api 53d8b4b ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **dialogflow:** update the api 0feb056 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **dialogflow:** update the api b49bfda ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **iam:** update the api 0832247 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **ideahub:** update the api 24483a4 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **metastore:** update the api 897beb3 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **metastore:** update the api dd83236 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **monitoring:** update the api 75a5ced ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **ondemandscanning:** update the api 6ffbe18 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **osconfig:** update the api c8b511a ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **osconfig:** update the api e079d43 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **oslogin:** update the api d3ec653 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **pubsublite:** update the api 4287a7d ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **pubsub:** update the api 06dfff2 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **recaptchaenterprise:** update the api ebfeb8f ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **recommender:** update the api 01f2d6c ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **speech:** update the api 601afcf ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **speech:** update the api 689fff2 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **sqladmin:** update the api 41d51e3 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **storagetransfer:** update the api 2456483 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) * **tagmanager:** update the api 47a522a ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) * **transcoder:** update the api 1e0b085 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f)) ### Bug Fixes * **fcm:** update the api f1dd412 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
1 parent 3e4b5db commit fd2965c

File tree

11 files changed

+608
-1
lines changed

11 files changed

+608
-1
lines changed

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
11
# Changelog
22

3+
## [2.16.0](https://www.github.com/googleapis/google-api-python-client/compare/v2.15.0...v2.16.0) (2021-08-10)
4+
5+
6+
### Features
7+
8+
* **accesscontextmanager:** update the api https://github.com/googleapis/google-api-python-client/commit/30216a669249442cac8f0fb8bb347b1352d8f087 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
9+
* **alertcenter:** update the api https://github.com/googleapis/google-api-python-client/commit/39b084706537111e8403be6e69f0fc9d82b2f383 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
10+
* **androidpublisher:** update the api https://github.com/googleapis/google-api-python-client/commit/cf67afc22e94f856773895a4e603e7a9a6bfa20b ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
11+
* **apigee:** update the api https://github.com/googleapis/google-api-python-client/commit/4485c5f3b32c9bda4f50a2a96c5870414f7d870f ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
12+
* **apigee:** update the api https://github.com/googleapis/google-api-python-client/commit/995336984e11fb9f91308d14a68faf8f3091d1fa ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
13+
* **appengine:** update the api https://github.com/googleapis/google-api-python-client/commit/eb7a571470cef08641224558a7bd8eaa07a41bad ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
14+
* **bigquery:** update the api https://github.com/googleapis/google-api-python-client/commit/304bbde2360066caf55575e3be5a04fdc8bf8b09 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
15+
* **chromemanagement:** update the api https://github.com/googleapis/google-api-python-client/commit/0ba28b47236a81a996a3607567b61ab38150617d ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
16+
* **chromepolicy:** update the api https://github.com/googleapis/google-api-python-client/commit/5654776fdc8361aa0703a7dca8069b576a1b2f73 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
17+
* **cloudasset:** update the api https://github.com/googleapis/google-api-python-client/commit/792aa5593ea64ceb4b565e950e153e396274b3b8 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
18+
* **cloudbuild:** update the api https://github.com/googleapis/google-api-python-client/commit/437e37f1c36268464f90e075ffeaef61580de237 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
19+
* **cloudbuild:** update the api https://github.com/googleapis/google-api-python-client/commit/6b06387ca29e76d26f257c7a4eb6864fe27e082e ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
20+
* **cloudchannel:** update the api https://github.com/googleapis/google-api-python-client/commit/0b0444ea192f79c5564745be8b1d52b52a74d1fb ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
21+
* **cloudkms:** update the api https://github.com/googleapis/google-api-python-client/commit/7dc278459cbd32bf15b39633327743cfa0beeea3 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
22+
* **cloudkms:** update the api https://github.com/googleapis/google-api-python-client/commit/ebd3f49f78738792032e431b73233ae0c458bae3 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
23+
* **composer:** update the api https://github.com/googleapis/google-api-python-client/commit/92131bff38ab7644e549f3d71f9c0a84755455db ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
24+
* **containeranalysis:** update the api https://github.com/googleapis/google-api-python-client/commit/9ab94f3f4c2ccafdf8b298dad8c6a5c2aa61a606 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
25+
* **containeranalysis:** update the api https://github.com/googleapis/google-api-python-client/commit/d446928f941d858022f0e1a1911bbf185920159d ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
26+
* **container:** update the api https://github.com/googleapis/google-api-python-client/commit/53d8b4b3e3c5d16ffd14ba1af1cf1769d9249067 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
27+
* **dialogflow:** update the api https://github.com/googleapis/google-api-python-client/commit/0feb05616eb28db7c35e128ebbf338b63446b8cf ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
28+
* **dialogflow:** update the api https://github.com/googleapis/google-api-python-client/commit/b49bfdaedbed3378b061e85f937a36e97732fcd4 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
29+
* **iam:** update the api https://github.com/googleapis/google-api-python-client/commit/0832247d126965b472a271167028499f015de1ae ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
30+
* **ideahub:** update the api https://github.com/googleapis/google-api-python-client/commit/24483a4f512922f809fc8352b9407e606856b0e2 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
31+
* **metastore:** update the api https://github.com/googleapis/google-api-python-client/commit/897beb3754da50e117292f5954265076804acb7f ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
32+
* **metastore:** update the api https://github.com/googleapis/google-api-python-client/commit/dd83236343d603e964613b16e9afa25eff60f97c ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
33+
* **monitoring:** update the api https://github.com/googleapis/google-api-python-client/commit/75a5ced2b372723c21d45b172dd69e0bb91c5509 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
34+
* **ondemandscanning:** update the api https://github.com/googleapis/google-api-python-client/commit/6ffbe182425ec217230fc083e217676e915bb786 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
35+
* **osconfig:** update the api https://github.com/googleapis/google-api-python-client/commit/c8b511a21f7fc7f2471d5f7a3b2d3760e4f8a629 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
36+
* **osconfig:** update the api https://github.com/googleapis/google-api-python-client/commit/e079d43be4291ca10be7caf432012c6553e0398e ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
37+
* **oslogin:** update the api https://github.com/googleapis/google-api-python-client/commit/d3ec653bdd293a63ae0b3772ce83e1fda73d5de5 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
38+
* **pubsublite:** update the api https://github.com/googleapis/google-api-python-client/commit/4287a7d537741391a9afe9e669b98010ed4fc0ab ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
39+
* **pubsub:** update the api https://github.com/googleapis/google-api-python-client/commit/06dfff22baec2551508b93e29e4c36fa442ab299 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
40+
* **recaptchaenterprise:** update the api https://github.com/googleapis/google-api-python-client/commit/ebfeb8fc00a1c6a8603b35640845c5cdacf53cb2 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
41+
* **recommender:** update the api https://github.com/googleapis/google-api-python-client/commit/01f2d6cc989ce337537a51ead8ffd3d6fc7e6c5d ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
42+
* **speech:** update the api https://github.com/googleapis/google-api-python-client/commit/601afcf08fd96421b64ef4c6f098f09f0748ce69 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
43+
* **speech:** update the api https://github.com/googleapis/google-api-python-client/commit/689fff21696add03b8c3ab843374b6bd2dd3cc16 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
44+
* **sqladmin:** update the api https://github.com/googleapis/google-api-python-client/commit/41d51e34759b181692ed96d9d490a9cfc5a28459 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
45+
* **storagetransfer:** update the api https://github.com/googleapis/google-api-python-client/commit/24564836842f792e9373ea505d97e775f64a5960 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
46+
* **tagmanager:** update the api https://github.com/googleapis/google-api-python-client/commit/47a522aac79ae9283a0c7ee7a2d0716e605d8c21 ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
47+
* **transcoder:** update the api https://github.com/googleapis/google-api-python-client/commit/1e0b0854e31f52013a8c5423efbd5e34c953e08c ([3e4b5db](https://www.github.com/googleapis/google-api-python-client/commit/3e4b5db2a4aeceb4b99f280e8a843c65284c2f9f))
48+
49+
50+
### Bug Fixes
51+
52+
* **fcm:** update the api https://github.com/googleapis/google-api-python-client/commit/f1dd412cad2a2cdd1863bb2942cf07fc6a42b649 ([b539cc4](https://www.github.com/googleapis/google-api-python-client/commit/b539cc475e81dc6f0d3c0f75b1e0445bb79fe9e5))
53+
354
## [2.15.0](https://www.github.com/googleapis/google-api-python-client/compare/v2.14.1...v2.15.0) (2021-07-27)
455

556

owlbot.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import synthtool as s
1616
from synthtool import gcp
1717

18+
from synthtool.languages import python
1819

1920
common = gcp.CommonTemplates()
2021

@@ -29,3 +30,12 @@
2930

3031
# Also move issue templates
3132
s.move(templated_files / '.github')
33+
34+
# Move scripts folder needed for samples CI
35+
s.move(templated_files / 'scripts')
36+
37+
# ----------------------------------------------------------------------------
38+
# Samples templates
39+
# ----------------------------------------------------------------------------
40+
41+
python.py_samples(skip_readmes=True)

samples/compute/noxfile.py

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from __future__ import print_function
16+
17+
import os
18+
from pathlib import Path
19+
import sys
20+
from typing import Callable, Dict, List, Optional
21+
22+
import nox
23+
24+
25+
# WARNING - WARNING - WARNING - WARNING - WARNING
26+
# WARNING - WARNING - WARNING - WARNING - WARNING
27+
# DO NOT EDIT THIS FILE EVER!
28+
# WARNING - WARNING - WARNING - WARNING - WARNING
29+
# WARNING - WARNING - WARNING - WARNING - WARNING
30+
31+
BLACK_VERSION = "black==19.10b0"
32+
33+
# Copy `noxfile_config.py` to your directory and modify it instead.
34+
35+
# `TEST_CONFIG` dict is a configuration hook that allows users to
36+
# modify the test configurations. The values here should be in sync
37+
# with `noxfile_config.py`. Users will copy `noxfile_config.py` into
38+
# their directory and modify it.
39+
40+
TEST_CONFIG = {
41+
# You can opt out from the test for specific Python versions.
42+
'ignored_versions': ["2.7"],
43+
44+
# Old samples are opted out of enforcing Python type hints
45+
# All new samples should feature them
46+
'enforce_type_hints': False,
47+
48+
# An envvar key for determining the project id to use. Change it
49+
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
50+
# build specific Cloud project. You can also use your own string
51+
# to use your own Cloud project.
52+
'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT',
53+
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
54+
# If you need to use a specific version of pip,
55+
# change pip_version_override to the string representation
56+
# of the version number, for example, "20.2.4"
57+
"pip_version_override": None,
58+
# A dictionary you want to inject into your test. Don't put any
59+
# secrets here. These values will override predefined values.
60+
'envs': {},
61+
}
62+
63+
64+
try:
65+
# Ensure we can import noxfile_config in the project's directory.
66+
sys.path.append('.')
67+
from noxfile_config import TEST_CONFIG_OVERRIDE
68+
except ImportError as e:
69+
print("No user noxfile_config found: detail: {}".format(e))
70+
TEST_CONFIG_OVERRIDE = {}
71+
72+
# Update the TEST_CONFIG with the user supplied values.
73+
TEST_CONFIG.update(TEST_CONFIG_OVERRIDE)
74+
75+
76+
def get_pytest_env_vars() -> Dict[str, str]:
77+
"""Returns a dict for pytest invocation."""
78+
ret = {}
79+
80+
# Override the GCLOUD_PROJECT and the alias.
81+
env_key = TEST_CONFIG['gcloud_project_env']
82+
# This should error out if not set.
83+
ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key]
84+
85+
# Apply user supplied envs.
86+
ret.update(TEST_CONFIG['envs'])
87+
return ret
88+
89+
90+
# DO NOT EDIT - automatically generated.
91+
# All versions used to tested samples.
92+
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]
93+
94+
# Any default versions that should be ignored.
95+
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
96+
97+
TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS])
98+
99+
INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False))
100+
#
101+
# Style Checks
102+
#
103+
104+
105+
def _determine_local_import_names(start_dir: str) -> List[str]:
106+
"""Determines all import names that should be considered "local".
107+
108+
This is used when running the linter to insure that import order is
109+
properly checked.
110+
"""
111+
file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)]
112+
return [
113+
basename
114+
for basename, extension in file_ext_pairs
115+
if extension == ".py"
116+
or os.path.isdir(os.path.join(start_dir, basename))
117+
and basename not in ("__pycache__")
118+
]
119+
120+
121+
# Linting with flake8.
122+
#
123+
# We ignore the following rules:
124+
# E203: whitespace before ‘:’
125+
# E266: too many leading ‘#’ for block comment
126+
# E501: line too long
127+
# I202: Additional newline in a section of imports
128+
#
129+
# We also need to specify the rules which are ignored by default:
130+
# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121']
131+
FLAKE8_COMMON_ARGS = [
132+
"--show-source",
133+
"--builtin=gettext",
134+
"--max-complexity=20",
135+
"--import-order-style=google",
136+
"--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py",
137+
"--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202",
138+
"--max-line-length=88",
139+
]
140+
141+
142+
@nox.session
143+
def lint(session: nox.sessions.Session) -> None:
144+
if not TEST_CONFIG['enforce_type_hints']:
145+
session.install("flake8", "flake8-import-order")
146+
else:
147+
session.install("flake8", "flake8-import-order", "flake8-annotations")
148+
149+
local_names = _determine_local_import_names(".")
150+
args = FLAKE8_COMMON_ARGS + [
151+
"--application-import-names",
152+
",".join(local_names),
153+
"."
154+
]
155+
session.run("flake8", *args)
156+
#
157+
# Black
158+
#
159+
160+
161+
@nox.session
162+
def blacken(session: nox.sessions.Session) -> None:
163+
session.install(BLACK_VERSION)
164+
python_files = [path for path in os.listdir(".") if path.endswith(".py")]
165+
166+
session.run("black", *python_files)
167+
168+
#
169+
# Sample Tests
170+
#
171+
172+
173+
PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"]
174+
175+
176+
def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None:
177+
if TEST_CONFIG["pip_version_override"]:
178+
pip_version = TEST_CONFIG["pip_version_override"]
179+
session.install(f"pip=={pip_version}")
180+
"""Runs py.test for a particular project."""
181+
if os.path.exists("requirements.txt"):
182+
if os.path.exists("constraints.txt"):
183+
session.install("-r", "requirements.txt", "-c", "constraints.txt")
184+
else:
185+
session.install("-r", "requirements.txt")
186+
187+
if os.path.exists("requirements-test.txt"):
188+
if os.path.exists("constraints-test.txt"):
189+
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
190+
else:
191+
session.install("-r", "requirements-test.txt")
192+
193+
if INSTALL_LIBRARY_FROM_SOURCE:
194+
session.install("-e", _get_repo_root())
195+
196+
if post_install:
197+
post_install(session)
198+
199+
session.run(
200+
"pytest",
201+
*(PYTEST_COMMON_ARGS + session.posargs),
202+
# Pytest will return 5 when no tests are collected. This can happen
203+
# on travis where slow and flaky tests are excluded.
204+
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
205+
success_codes=[0, 5],
206+
env=get_pytest_env_vars()
207+
)
208+
209+
210+
@nox.session(python=ALL_VERSIONS)
211+
def py(session: nox.sessions.Session) -> None:
212+
"""Runs py.test for a sample using the specified version of Python."""
213+
if session.python in TESTED_VERSIONS:
214+
_session_tests(session)
215+
else:
216+
session.skip("SKIPPED: {} tests are disabled for this sample.".format(
217+
session.python
218+
))
219+
220+
221+
#
222+
# Readmegen
223+
#
224+
225+
226+
def _get_repo_root() -> Optional[str]:
227+
""" Returns the root folder of the project. """
228+
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
229+
p = Path(os.getcwd())
230+
for i in range(10):
231+
if p is None:
232+
break
233+
if Path(p / ".git").exists():
234+
return str(p)
235+
# .git is not available in repos cloned via Cloud Build
236+
# setup.py is always in the library's root, so use that instead
237+
# https://github.com/googleapis/synthtool/issues/792
238+
if Path(p / "setup.py").exists():
239+
return str(p)
240+
p = p.parent
241+
raise Exception("Unable to detect repository root.")
242+
243+
244+
GENERATED_READMES = sorted([x for x in Path(".").rglob("*.rst.in")])
245+
246+
247+
@nox.session
248+
@nox.parametrize("path", GENERATED_READMES)
249+
def readmegen(session: nox.sessions.Session, path: str) -> None:
250+
"""(Re-)generates the readme for a sample."""
251+
session.install("jinja2", "pyyaml")
252+
dir_ = os.path.dirname(path)
253+
254+
if os.path.exists(os.path.join(dir_, "requirements.txt")):
255+
session.install("-r", os.path.join(dir_, "requirements.txt"))
256+
257+
in_file = os.path.join(dir_, "README.rst.in")
258+
session.run(
259+
"python", _get_repo_root() + "/scripts/readme-gen/readme_gen.py", in_file
260+
)

0 commit comments

Comments
 (0)