Commit Graph

56 Commits

Author SHA1 Message Date
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
Craig Tiller 272a89ad2b
[include-guards] Fix regular expression (#33270)
It's completely legitimate to have a zero in a filename/include guard.

<!--

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-05-30 09:22:24 -07:00
Mark D. Roth 1432fe4e4c
[JSON] make API public but experimental (#32987)
This makes the JSON API visible as part of the C-core API, but in the
`experimental` namespace. It will be used as part of various
experimental APIs that we will be introducing in the near future, such
as the audit logging API.
2023-05-09 08:05:24 -07:00
Craig Tiller 2bcca66712
[fuzzing] Roll forward dep on fuzztest (#32667)
<!--

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.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-21 13:37:32 -07:00
Craig Tiller 522bed8cc6
Revert "[fuzzing] Add dep on google fuzz test" (#32666)
Reverts grpc/grpc#32578
2023-03-20 20:31:06 -07:00
Craig Tiller dbb131b193
[fuzzing] Add dep on google fuzz test (#32578)
Initial PR to establish a bazel dependency on
https://github.com/google/fuzztest, with which I'm planning on basing a
hardening program.

Casting a relatively wide net with reviewers: I'm genuinely interested
in feedback building up the docs, and general ergonomics of this change.

I've located relevant files in the `fuzztest/...` directory. The tests
only build with the `--config fuzztest` bazel argument for now (because
of needing C++17), so locating them separately keeps `bazel test
test/...` working as it does today. In a few years time, when we adopt
C++17, we'll be able to rationalize the test directories a little bit.

We'll need to add some kokoro jobs (maybe with this PR?) to execute the
relevant tests.

<!--

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.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-20 17:45:52 -07:00
Yash Tibrewal aa11978541
Fix include guards for src/ and test/ directories (#32167)
* Fix include guards for src/ and test/ directories

* Sanity

* Update new files
2023-01-20 16:27:27 -08:00
Yijie Ma f99b8b5bc4
Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Craig Tiller 6532084a06
[iwyu] rest of the owl: src/core/lib - excluding iomgr, gpr (#29735)
* [iwyu] rest of the owl: src/core/lib - excluding iomgr, gpr

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fixes

* Automated change: Fix sanity tests

* fix

* fix

* fixes

* fixes

* x

* fix?

* fix

* windows fix

* fix

* fix

* fix

* fix

* fix

* debug

* fix

* fix

* Revert "debug"

This reverts commit c99b8d12dd.

* Automated change: Fix sanity tests

* fix?

* Automated change: Fix sanity tests

* header cleanup

* fix

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fixes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-06-10 13:04:47 -07:00
Richard Belleville 59693b7e72
Migrate Infrastructure Scripts to Python 3 (#27135)
* Run 2to3 on tools directory

* Delete github_stats_tracking

* Re-run 2to3

* Remove unused script

* Remove unused script

* Remove unused line count utility

* Yapf. Isort

* Remove accidentally included file

* Migrate tools/distrib directory to python 3

* Remove unnecessary shebang

* Restore line_count directory

* Immediately convert subprocess.check_output output to string

* Take care of Python 2 shebangs

* Invoke scripts using a Python 3 interpreter

* Yapf. Isort

* Try installing Python 3 first

* See if we have any Python 3 versions installed

* Add Python 3.7 to Windows path

* Try adding a symlink

* Try to symlink differently

* Install six for Python 3

* Run run_interop_tests with python 3

* Try installing six in python3.7 explicitly

* Revert "Try installing six in python3.7 explicitly"

This reverts commit 2cf60d72f3.

* And debug some more

* Fix issue with jobset.py

* Add debug for CI failure

* Revert microbenchmark changes
2021-11-08 08:55:25 -08:00
Richard Belleville b6cc72f129
Revert "Run 2to3 on tools directory (#26002)" (#27183)
This reverts commit a388361c3d.
2021-08-30 12:29:20 -07:00
Richard Belleville a388361c3d
Run 2to3 on tools directory (#26002)
* Run 2to3 on tools directory

* Delete github_stats_tracking

* Re-run 2to3

* Remove unused script

* Remove unused script

* Remove unused line count utility

* Yapf. Isort

* Remove accidentally included file

* Restore line_count directory
2021-08-30 09:25:21 -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
AJ Heller 4d4ee609c1
gRPC EventEngine Interface (#25795) 2021-04-05 09:26:16 -07:00
AJ Heller afd2b354f2
Fix crash in copyright check script, unknown var endif_re (#25855) 2021-03-31 17:06:13 -07:00
Sergii Tkachenko 8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
Esun Kim ab44f737ec py2to3 sanity scripts 2020-12-11 13:37:36 -08:00
Jan Tattermusch e36ee8ef19 fix sanity tests 2020-08-21 11:37:41 +02:00
nanahpang 2676c16b76
Update check_include_guards.py
Sanity Check.
2020-08-04 11:10:54 -07:00
nanahpang 997e6a7910
Update check_include_guards.py
Fixed the Py3 checker issue during import. Use print() instead of print and add "from __future__ import print_function" for py2 and py3 compatibility.
2020-08-03 12:20:56 -07:00
Mark D. Roth 41d87b7307 Allow C++-style comments on #endif lines. 2020-07-31 11:40:12 -07:00
Mark D. Roth a0f08b1b06 Revert "Merge pull request #21941 from markdroth/xds_logging"
This reverts commit 37d5d93983, reversing
changes made to 0e8190a3c9.
2020-07-17 10:19:28 -07:00
Mark D. Roth c1d7180daa Use upb textformat library to dump out raw xDS proto messages 2020-06-24 10:10:03 -07:00
Mark D. Roth 03411d7be7 Second attempt: grpclb stabilization 2020-03-31 07:52:44 -07:00
Jan Tattermusch 3f3cf8b62a
Revert "grpclb stabilization" 2020-01-20 14:11:16 +01:00
Mark D. Roth 5b18402914 grpclb stabilization 2020-01-10 09:13:10 -08:00
Esun Kim 7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
Vishal Powar f569cc1b36 Add BUILD rul and generated upb code for protos required to do DiscoveryRequest to xDS server
Also,
  - cleanup check scripts to look for file extension to exempt upb
  generated code.
2019-03-15 14:16:08 -07:00
Vishal Powar 319fcdf26e Add a script for generating C code and build rule for protobuf protos.
All these changes need to go together to make sense
  - changes to use new version of upb in bazel
  - allowing includes in build target option
  - script for generating c code (upb) for protos
  - generated code for example protos
  - adding changes for non-bazel builds
  - change sanity tests to ignore the generated files.
2019-03-13 12:53:17 -07:00
Alexander Polcyn ac6795a57e Revert "Changes add a script for generating C code and build rule for protobuf"
This reverts commit 62027b7e14.
2018-12-12 11:40:25 -08:00
Vishal Powar 62027b7e14 Changes add a script for generating C code and build rule for protobuf
protos

All these changes need to go together to make sense
  - changes to use new version of upb in bazel
  - allowing includes in build target option
  - script for generating c code for protos
  - generated code for example build
  - adding changes for non-bazel builds
  - change sanity tests to ignore the generated files.
2018-12-11 14:59:02 -08:00
Mark D. Roth f85fd026e3 Client-side health checking support. 2018-10-24 12:29:04 -07:00
David Garcia Quintas f3955ba711 Update to use the canonical version of LB proto 2018-06-21 17:46:31 -07:00
Yihua Zhang 04fb58efbd Add ALTS code to grpc/core 2018-03-08 06:49:24 -08:00
Sree Kuchibhotla ae277dd000
Revert "Add ALTS C stack to gRPC core" 2018-03-07 14:35:36 -08:00
Yihua Zhang eaf6486677 Add ALTS code to grpc/core 2018-03-06 21:40:45 -08:00
Muxi Yan 0e00c43082 Move headers from grpc++ to grpcpp 2018-02-15 14:49:34 -08:00
Mehrdad Afshari 87cd994b04 Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
2018-01-02 14:40:00 -08:00
ncteisen 7a2be20a8a yapf tools/distrib 2017-12-11 16:49:19 -08:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Craig Tiller 9eb0fdec00 Reorganize ext tree
- filters live under filters
- lb_policy, resolver implementations (being part of client_channel) live under client_channel
2017-03-31 16:59:30 -07:00
David Garcia Quintas ffd207fe4c fixed include guard script and faulty .h 2016-08-01 16:20:52 -07:00
Yuchen Zeng d23710787b Merge remote-tracking branch 'upstream/master' into reflection_separate_lib 2016-06-07 15:00:52 -07:00
Yuchen Zeng 7ae31a8898 Add more comments, fix format issues 2016-06-06 14:35:51 -07:00
Jan Tattermusch 64a553ff4a Merge pull request #6329 from dgquintas/tiny_include_guard_fix
Tiny fix to check_include_guards script
2016-05-18 07:30:51 -07:00
David Garcia Quintas 93466168b0 Allow for multiline #endif guards 2016-05-12 16:41:27 -07:00
Jan Tattermusch fffd296bc5 Merge pull request #6279 from dgquintas/lb_proto_v1
Updated load balancer proto to v1
2016-05-10 10:15:42 -07:00
David Garcia Quintas c74f62bcfc Don't try to read files that have been moved/renamed. 2016-04-28 00:57:34 -07:00
David Garcia Quintas 267684ca06 Tiny fix to check_include_guards script 2016-04-27 18:32:04 -07:00
David Garcia Quintas 7f0793ad62 Updated load balancer proto to v1 2016-04-25 16:48:26 -07:00