Commit Graph

16 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
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
Sergii Tkachenko 8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
Esun Kim 7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -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 5f8bf79bbf yapf tools 2017-12-11 18:10:00 -08:00
Craig Tiller 8a08400af2 Fix spam 2017-07-14 14:49:09 -07:00
Craig Tiller 98240d07b4 Fix another merging bug in mkowners 2017-07-14 14:16:01 -07:00
Craig Tiller 92a85558bc Fix argument ordering 2017-07-14 11:36:09 -07:00
Craig Tiller 7976bdd09b Change from intersection to supersets for glob comparisons
This has the disadvantage that we can only use the current tree to
collect evidence of overlap -- this means that it's possible for file
addition or deletion to force a CODEOWNERS update.

HOWEVER, it has the advantage that it's correct and propagates ownership
in the way that we want (alleviating murgatroid@ from having to approve
every additional file in the repository)
2017-07-14 11:30:14 -07:00
Nicolas Noble eb020ce29d Few fixes for mkowners.py.
-) Paths should all be absolute to /
-) Computing the intersection of two globs should happen with the
full path in there, not just the directory's glob.
2017-07-13 13:20:13 -07:00
Craig Tiller 22d9516434 Use ** for OWNERS files for trees 2017-07-13 10:02:30 -07:00
Craig Tiller 80a87ea820 Fix copyrights 2017-07-13 09:11:06 -07:00
Craig Tiller e476f7d33f Strawman OWNERS --> CODEOWNERS script 2017-07-13 08:52:00 -07:00