34 Commits

Author SHA1 Message Date
Sergii Tkachenko
b04d3821d4 [CI] Bump pylint to 2.17.7 (#40169)
In preparation for migrating it from python3.7 to python3.11.
Pylint version had to be upgraded because pylint==2.2.2 doesn't support python 3.11.

The image will be updated separately to remove compiling python3.7 from source in #40139.

Pylint v2.17.7 docs: https://pylint.readthedocs.io/en/v2.17.7

Closes #40169

PiperOrigin-RevId: 783026287
2025-07-14 13:45:05 -07: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
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
Yash Tibrewal
41ec08c69a Update third_party/protobuf to 3.21.4 (#30377)
* Update third_party/protobuf

* run tools/distrib/python/make_grpcio_tools.py

* regenerate protos for ruby, php

* update build_handwritten.yaml

* regenerate projects

* Build - Use :well_known_type_protos instead of :well_known_protos

* Fix target

* Update upb

* Update Python for Protobuf 4.21 (#140)

* Update protobuf dependency on grpcio-tools

* Off by one

* Drop python 3.6 support

* Try upgrading pip

* And in the other script

* Try to figure out if we're compatible with abi3

* See what we've already got installed

* Update the requirements.txt file I didn't know existed

* And here too

* See what's installed

* Let's try that again

* Remove

* Try to confirm version

* Let me see the generated code

* Fix non-Bazel test runner

* Work for all test directories

* Regenerate example protos

* Clean up

* Generate .pyi files

* Fix type checking and linting

* Exclude pyi files from isort

* Upgrade to 3.21.4

* Update iwyu to get around messy protobuf IWYU rules

Co-authored-by: Richard Belleville <gnossen@gmail.com>
2022-08-04 09:39:49 -07: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
Craig Tiller
d1e01ac139 Add a test for a (now-illegal) build file construct (#27602)
* Add a test for a (now-illegal) build file construct

* add to test suite!

* fix

* fix

* fix syntax
2021-10-06 07:43:59 -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
f6e6b9f640 Fix the pylint complain 2020-04-30 15:16:32 -07:00
Taras Galkovskyi
f375c0b548 minor stylistic fixes 2020-04-30 18:58:44 +00:00
Taras Galkovskyi
d62df731a0 pacify pylint on examples folder 2020-04-29 23:22:22 +00:00
Taras Galkovskyi
469631f549 run yapf; delete alts unit tests 2020-04-29 22:50:35 +00:00
Taras Galkovskyi
486e27e2de fix formatting issues 2020-04-29 19:43:45 +00:00
Taras Galkovskyi
42bd106898 updating comments to make clear that ALTS is only supported on GCP 2020-04-15 22:14:08 +00:00
Taras Galkovskyi
02da3330c2 address review comments 2020-04-15 18:13:04 +00:00
Taras Galkovskyi
72cd29266d simplify ALTS client 2020-04-10 14:27:30 +00:00
Taras Galkovskyi
828ee320a4 Expose ALTS client/server credentials on Python layer 2020-04-07 00:14:41 +00:00
Vijay Pai
717a29d096 Fix formatting 2020-03-02 13:01:30 -08:00
Vijay Pai
b3bca043b2 Explain that this has Chinese comments with English translation 2020-03-02 10:22:12 -08:00
Esun Kim
7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
chentanjun
4ecc1fe6a4 fix the wrong word 2019-10-01 05:13:33 +08:00
kerbalwzy
d06ccebb1e Fix: remove the space on the left of colons 2019-09-17 09:37:56 +08:00
kerbalwzy
f3fdd259c1 Fix: fix the wrong word and delete line number description 2019-09-15 15:12:45 +08:00
kerbalwzy
c5d55ee64f Fix: add copyright headers in server.py 2019-09-11 10:27:15 +08:00
kerbalwzy
5c0fd4b4e6 Fix: add copyright headers in demo.proto 2019-09-11 10:23:31 +08:00
kerbalwzy
1b47584cf4 Fix: add copyright headers in client.py 2019-09-11 10:20:23 +08:00
kerbalwzy
5abf2e5095 Fix: add a blank line before the subtitle 2019-09-11 09:53:14 +08:00
kerbalwzy
1859799ee3 Fix: update README because code reformat by YAPF script 2019-08-30 08:55:01 +08:00
kerbalwzy
5c0fed241d Fix: reformat code with YAPF script, and check with PyLint 2019-08-30 08:44:20 +08:00
kerbalwzy
25a1caa9b0 Update: add proto3 document link, change chinese translation and comment of 'unary' 2019-08-30 08:30:07 +08:00
kerbalwzy
deee1f0826 Update: add offical guide link 2019-08-30 08:24:38 +08:00
kerbalwzy
d5810a155b Fix: rebuild README files 2019-08-27 11:14:36 +08:00
kerbalwzy
55f1899d78 Update:the max_workers argument use default, use 'server.wait_for_termination()' to keep process alive 2019-08-27 10:36:35 +08:00
kerbalwzy
151f596054 Fix: Cancel the modification of the package search path and Remove useless notes 2019-08-27 10:17:08 +08:00
kerbalwzy
caf64469f0 Update: rename the folder 2019-08-27 10:08:29 +08:00