Commit Graph

21 Commits

Author SHA1 Message Date
Mark D. Roth
0944410d6c [reorg] move test/core/util -> test/core/test_util (#36446)
Closes #36446

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36446 from markdroth:reorg_test 5dcc85e006581a8fc52a3a914baa5f33e4a21589
PiperOrigin-RevId: 629229220
2024-04-29 17:06: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
Richard Belleville
73dcfd375d Fix relative imports for Python 3 (#27971)
* Fix relative imports for Python 3

* Remove space

* isort
2021-11-08 15:37:32 -08: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 2cf60d72f388a95d642b2c99a775d88a6248f788.

* 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
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
zhungxd
e4cdcb7b25 fix wrong path 2020-09-09 19:41:32 +08:00
Jan Tattermusch
4847f85367 make port server python3 compatible 2020-07-13 11:35:07 +02:00
Esun Kim
7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
Richard Belleville
96b9538e4e Yapf all the things 2018-11-05 11:25:47 -08:00
Richard Belleville
666fb1c5ee Make run_tests.py python-version agnostic 2018-11-02 14:18:58 -07: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
05687c3da9 yapf tools/run_tests/python_utils 2017-12-11 16:54:47 -08:00
Jan Tattermusch
7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Craig Tiller
ddc8a8243d Fix port server on Windows 2017-05-05 14:02:35 -07:00
Craig Tiller
5474c6b3d4 Merge branch 'traceback_port_server' of github.com:dgquintas/grpc into always-use-port-server 2017-02-17 10:29:40 -08:00
Craig Tiller
cba864bfbe Eliminate port server env var, force its use always, consolidate code 2017-02-17 10:27:56 -08:00
David Garcia Quintas
46a1cca0ee Cleanup and better logging 2017-02-16 11:59:42 -08:00
Craig Tiller
37bfff35ee Fix port server 2017-02-14 22:35:39 -08:00
Craig Tiller
6911d08388 Fix platform_string() usage, cut temporary space usage 2017-02-07 10:30:44 -08:00
Craig Tiller
7dc4ea66f0 Make the microbenchmark profile gatherer run some in parallel 2017-02-02 16:08:05 -08:00