22 Commits

Author SHA1 Message Date
Marcel
ff7d726a91 [Python Bazel] Use PyInfo provider and py_* rules from rules_python (#37995)
The native one will be removed soon (Bazel 8?).

Closes #37995

PiperOrigin-RevId: 690671136
2024-10-28 10:47:26 -07:00
Xuan Wang
cd68c5e783 [Python Example] Add token based authentication example (#35477)
Add token based authentication example

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2024-01-10 11:06:46 -08:00
Xuan Wang
cedef1b7f3 [Python example] Add example for TLS (#34116)
Add example for TLS.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-08-22 13:02:40 -07:00
Sergii Tkachenko
de6ed9ba9f [Python] Migrate from yapf to black (#33138)
- Switched  from yapf to black
- Reconfigure isort for black
- Resolve black/pylint idiosyncrasies 

Note: I used `--experimental-string-processing` because black was
producing "implicit string concatenation", similar to what described
here: https://github.com/psf/black/issues/1837. While currently this
feature is experimental, it will be enabled by default:
https://github.com/psf/black/issues/2188. After running black with the
new string processing so that the generated code merges these `"hello" "
world"` strings concatenations, then I removed
`--experimental-string-processing` for stability, and regenerated the
code again.

To the reviewer: don't even try to open "Files Changed" tab 😄 It's
better to review commit-by-commit, and ignore `run black and isort`.
2023-06-09 15:08:55 -07:00
Ian Rodney
cfd3395e9b explain that keys must be lower cased (#31586) 2023-01-10 16:42:29 -08:00
Lidi Zheng
2231c2ba77 Introduce Python import sorting to our sanity test suite (#26768)
* Add isort_code.sh to sanity tests

* Run tools/distrib/isort_code.sh

* Fine tune the import order for relative imports

* Make pylint and project generation happy

* Fix a few corner cases

* Use --check instead of --diff

* The import order impacts test result somehow

* Make isort print diff and check output at the same time

* Let tools/run_tests/python_utils be firstparty library

* Run isort against latest HEAD
2021-07-26 12:31:21 -07:00
Sergii Tkachenko
8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
Lidi Zheng
40a5a655af Polish and add AsyncIO examples
* Add type annotations
* Add test for asyncio auth example
* Use dynamic stubs to allow same code runs manually and under Bazel
* Add grpcio-tools as a Bazel dependency
* asyncio.run is not yet existed in 3.6
* Improve readability
2020-12-08 13:44:43 -08:00
Esun Kim
7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
Lidi Zheng
c34bef4ca4 Format all Bazel files with buildifier 2019-11-05 14:03:52 -08:00
Richard Belleville
1444cd1dd3 Revert "Revert "Merge pull request #20097 from gnossen/dual_version_python_tests""
This reverts commit 24c562dbaa.
2019-08-29 10:51:36 -07:00
Richard Belleville
24c562dbaa Revert "Merge pull request #20097 from gnossen/dual_version_python_tests"
This reverts commit c9c847f334, reversing
changes made to 07ba4de392.
2019-08-29 10:47:44 -07:00
Richard Belleville
27990a5541 Explicitly add python versions to examples. 2019-08-27 17:47:52 -07:00
Richard Belleville
d932d2368e Merge pull request #19852 from gnossen/server_termination
Quit waiting for a day
2019-08-08 09:53:10 -07:00
Richard Belleville
79611aca51 Fix up unit test 2019-08-05 17:25:16 -07:00
Richard Belleville
e32980fba2 Quit waiting for a day 2019-08-05 16:19:49 -07:00
Richard Belleville
2b7ec3ad23 Fix up examples. 2019-08-01 16:18:45 -07:00
Lidi Zheng
ce41cde908 Fix string/bytes problem && lint 2019-06-26 09:46:05 -07:00
Lidi Zheng
7b82924066 Update module import according to name changes 2019-06-25 10:20:25 -07:00
Lidi Zheng
aa567e5364 Adopt reviewer's advices 2019-06-24 17:58:11 -07:00
Lidi Zheng
5f98b1e8ef Fix 2/3 str/bytes compatibility issue 2019-06-24 17:13:42 -07:00
Lidi Zheng
12c296b3dc [Python] Add authentication extension example 2019-06-24 16:39:51 -07:00