Commit Graph

26 Commits

Author SHA1 Message Date
Nathan Baulch
8342a109ae Fix python typos (#38029)
Continuation of #37541 but focused on Python.

Top typos are:
* resolveable (5)
* dedecated (4)
* everyting (4)
* programatically (3)
* supercede (3)
* wil (3)
* acknowledgment (2)
* corutine (2)
* coversion (2)
* operaton (2)
* wich (2)

Closes #38029

PiperOrigin-RevId: 695759207
2024-11-12 09:15:38 -08:00
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
Michael
c4bbaa25f8 Fix Typos In Docs & Code Comments (#37170)
There are several typos in files within the ./examples/* directory, so just a PR to fix them

Closes #37170

PiperOrigin-RevId: 650818587
2024-07-09 18:25:39 -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
Xuan Wang
10e5b2115e Add wait_for_ready with client timeout example (#32183)
* Add wait_for_ready with client timeout example

* Use with to create channel

* Fix sanity tests

* Changes based on comments

* Change thread to daemon thread

* Changes based on comments
2023-01-25 11:02:13 -08:00
Richard Belleville
468768865b Make Buildifier Sanity Test Strict (#27807)
* Fix all lint errors in repo.

* Use strict buildifier by default

* Whoops. That file does not exist

* Attempt fix to buildifier invocation

* Add missing copyright
2021-11-03 14:57:04 -07: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
Lidi Zheng
e6dffc6fbe Adding three more AsyncIO examples
* Channelz or Debug
* Route guide
* Wait for ready
2021-01-06 10:52:39 -08:00
Esun Kim
e0ebe46ad3 Fix python examples 2020-12-23 09:23:32 -08:00
Esun Kim
e7afadc255 Refactor examples BUILD files 2020-12-23 09:23:32 -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
e32980fba2 Quit waiting for a day 2019-08-05 16:19:49 -07:00
Richard Belleville
7b2c8c27b0 Separate py_grpc_library and py_proto_library.
By popular demand, we'll now be offering separate py_grpc_library and
py_proto_library targets sharing the same interface as within google3.
This change necessitated some modifications to how we pull in our own
Python-level dependencies and how we make those available to those
pulling in our project via Bazel.

There is now a grpc_python_deps() Bazel workspace rule that pulls in the
appropriate dependencies, which should be called from the client
project's WORKSPACE file. A test has been added to the bazel/test/
directory to verify that this behavior works as intended.

It's worth noting that the protobuf repository's usage of Starlark
bind() caused a great deal of trouble in ensuring that we could also
pull in six.

This change also required a change in the way generated proto code is
imported in the channelz and health-check modules, as well as in their
associated tests. We were importing them two different ways, each
relative. This resulted in two different module objects being imported
into the process, which were incompatible. I am not sure exactly what
caused this behavior to begin, as this should have been possible before
this PR. As a workaround, I am simply trying two different absolute
imports and using the one that works. This should function both inside
and outside of Bazel environments.
2019-08-01 15:16:22 -07:00
Richard Belleville
930cec4e27 Revert "Merge pull request #18912 from grpc/revert-bazel-changes"
This reverts commit c9a259aa3a, reversing
changes made to 9c882bc725.
2019-04-30 11:17:11 -07:00
Richard Belleville
50b5240d0a Revert "Merge pull request #18859 from grpc/internal_py_proto_library"
This reverts commit 5b720f19c1, reversing
changes made to a64ae3c0d5.
2019-04-29 17:47:56 -07:00
Richard Belleville
5391d8427e Moar ipv6 2019-04-25 13:53:23 -07:00
Richard Belleville
aec0860ebf Remove redundant line 2019-04-25 12:56:46 -07:00
Richard Belleville
1c65fd19e8 Fix wait_for_ready example for ipv4-only environments like Kokoro 2019-04-25 12:55:58 -07:00
Richard Belleville
4de4a7da7b Reenable python bazel tests 2019-04-25 10:27:01 -07:00
Lidi Zheng
f062722c61 Adopt reviewer's advice
* Use context manager to manage tcp socket
* Rename tcp socket
* Fix grammer error
2019-04-16 13:44:46 -07:00
Lidi Zheng
541cb00470 Add wait-for-ready example
* With unit test
* With Bazel integration
* With REAME.md explaination
2019-04-16 12:24:23 -07:00