Commit Graph

33 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
Jan Tattermusch eb79b6b178
More run_microbenchmark.py cleanup (#28893)
* cleanup

* update TODOs

* fixup
2022-02-17 19:14:08 +01: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 5139a012e7
Migrate the bm_diff benchmarks to python3 (#25619)
* Migrate the bm_diff benchmarks to python3

Includes a requirements.txt pinned at ~2017 versions, when this script
was first written.

* Replace p2 with p3 scipy/numpy dependencies.

* py2->3 for benchmark setup scripts

* upgrade pip to resolve python3 cryptography/setuptools-rust problem

* re-add jobset import (accidentally removed)

* re-add six's urllib import. This file is still used in py2 tests

* force py3 in run_if_c_cpp_modified.sh

* Fix another instance of subprocess.check_output binary mode

* Use the requirements.txt for CI perf environment setup

* Try to upgrade PyJWT. (v2.0.0 was problematic, #25053)

v2.x makes encode return strs from jwt.encode in both py2 and py3.
Previously, py3 would return bytes, and py2 a str.

* upgate cryptography lib version requirements for jwt.

* Wrap pip requirements specifier in quotes '>=x,<y'

* Decode subprocess output once instead of for every line

* Revert "Decode subprocess output once instead of for every line"

This reverts commit 28d14026431622ac7afd3535a8d7118e5be96628.

py2 doesn't support the `text` argument to subprocess.check_output.

* Address reviewer requests

* Pin a valid scipy version

* Remove scipy and tabulate dependencies from macos tests
2021-03-09 15:44:00 +01:00
Sergii Tkachenko 8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
Jan Tattermusch 746479ad80 fix performance profile jobs 2018-04-11 21:59:09 +02: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 173c477bd0 tools/profiling 2017-12-11 16:52:44 -08:00
Craig Tiller e6d2e8f16b Fix case on internal type names
Should allow microbenchmarks to get running again
2017-09-13 06:10:18 -07:00
Craig Tiller 54f3c2eefe Automatically fetch schema from BigQuery 2017-09-11 13:12:04 -07:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Craig Tiller e1523e95c1 Track calls to gpr_now() 2017-03-14 21:10:42 -07:00
Craig Tiller bbfb25bf70 Sanitize before bigquery upload 2017-03-10 17:24:45 -08:00
Craig Tiller 3651eece9b Fix merge error 2017-03-06 16:15:48 -08:00
Craig Tiller 77bcd5a58a Merge github.com:grpc/grpc into nudiff 2017-03-06 16:15:10 -08:00
Craig Tiller adade61028 Merge branch 'diff_perf' into nudiff 2017-03-06 16:13:04 -08:00
Craig Tiller b699640a77 Factor out benchmark parsing code to enable diffs more easily 2017-03-06 16:10:20 -08:00
Craig Tiller 4883fd8a20 Merge github.com:grpc/grpc into call_create_fixtures 2017-03-01 13:32:33 -08:00
Craig Tiller 541b87e015 Report non-counter cpu times to bigquery to get more accurate dashboards 2017-03-01 08:42:52 -08:00
Craig Tiller 8d9d4d00fd Add benchmark to conversion script 2017-03-01 07:57:20 -08:00
Craig Tiller e177c24b5f Fix uploader 2017-02-25 07:39:05 -08:00
Craig Tiller bc34a08bf5 Merge github.com:grpc/grpc into bm_error 2017-02-23 08:57:22 -08:00
Craig Tiller 11468c0c2a Merge branch 'bm_call_create' into bm_error 2017-02-22 14:24:48 -08:00
Craig Tiller 385b00932c Cleanup 2017-02-22 13:45:01 -08:00
Craig Tiller ebcba69bc0 Fix typo 2017-02-21 13:31:24 -08:00
Craig Tiller 7f4d30a032 Separate CAS/ADD RMWs 2017-02-21 10:24:00 -08:00
Craig Tiller 3d826b9e0a Fix script to track atomic rmws 2017-02-21 10:05:59 -08:00
Craig Tiller 264307fa3d Add benchmarks for grpc_error 2017-02-16 09:07:45 -08:00
Craig Tiller 3f878bc784 Update microbenchmarking framework for new benchmark 2017-02-15 08:33:09 -08:00
Craig Tiller d9bc2107e5 Update microbenchmarking framework for new benchmark 2017-02-15 08:24:55 -08:00
Craig Tiller aa64ddf109 Allow uploading results to BigQuery 2017-02-08 14:20:08 -08:00