Commit Graph

19 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 a3be072605
Switch .py shebang to python3 (#28963)
* switch shebang to python3

* prepare_build_macos: install latest available patch for each python
2022-03-14 10:41:30 +01:00
Jan Tattermusch f23e1d9e85
task_runner.py improvements (foundations for future speedup) (#28480)
* add --dry_run support for task_runner.py

* dont sort task_runner targets before running

* fixup dry run

* support task_runner.py --inner_jobs

* pass inner_jobs to build_jobspec for task_runner.py

* support inner_jobs for C# artifacts

* support inner_jobs for protoc artifacts

* inner jobs support for src/csharp/experimental/build_native_ext_for_android.sh

* address review feedback
2022-01-11 10:26:32 +01:00
Jan Tattermusch 240557a55c
run_tests family scripts: autodetect TTY when running docker (#28124)
* autodetect terminal when running docker, add helptext for --travis run_tests arg

* address a TODO

* remove --travis from task_runner.py
2021-12-10 06:52:50 +01: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
Jan Tattermusch 7d8a59cc6e
Python simpler distribtests (#26176)
* add single-job python distribtests for linux

* add kokoro job config grpc_distribtests_python.cfg

* address review comments
2021-05-07 10:31:43 -07:00
Jan Tattermusch 37c980d98a improve python3 compatibility of the task_runner.py script 2020-08-28 10:14:17 -04:00
Esun Kim 7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
ncteisen 888093c6ed yapf run_tests 2017-12-11 18:08:35 -08:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Jan Tattermusch 47c7521960 simplify building artifacts on a single machine 2017-05-12 10:18:49 +02:00
Siddharth Shukla 8e64d901fd Modify shebang on python scripts
Change shebangs to `#!/usr/bin/env python` instead of
`#!/usr/bin/env python2.7`.
2017-03-12 19:53:12 +01:00
Jan Tattermusch 5c79a3199c cleanup tools/run_tests directory 2016-12-22 10:47:52 +01:00
siddharthshukla 0589e533cd Make testing toolchain python 3.x compliant
six is necessary for making these scripts cross compatible
between python 2.x and 3.x

Changes:
Add six to python_deps.include
Include python_deps.include to all Dockerfile templates in test directory
Include python_deps.include to all Dockerfile templates in stress_test directory
Include python_deps.include to all Dockerfile templates in interop_test directory
Replace print statements with print function calls (from futute..)
Replace .iteritems() with .items() wherever necessary
use six.moves to import BaseHTTPServer
Generate new dockerfiles using generate_projects.sh
2016-07-12 01:35:53 +02:00
Nathaniel Manista cbf21da6e4 /usr/bin/env python -> /usr/bin/env python2.7 2016-02-02 22:17:44 +00:00
Jan Tattermusch 38b519a48d replace nuget version by placeholder 2016-02-01 14:06:50 -08:00
Jan Tattermusch be538a1a79 generalize build_artifacts.py 2016-01-28 15:50:57 -08:00