FR(python): update owlbot_main() to automatically sort python imports using isort with --fss
option
#1401
Labels
lang: python
Issues specific to Python.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
There are at least 2 benefits of using
isort
to automatically sort python imports in googleapis python-* repos.For example, The
__init__.py
file in the python-dataproc repo decreased by 40% after runningisort
Note: The
lint
nox session in the noxfile in the python samples templated files expects strict alphabetical ordering for imports so we need to use the-fss
option ofisort
. From the docs on the--fss
option:The lint session expects strict alphabetical order:
not
Without the
--fss
option, here is the error that we see in lintThe text was updated successfully, but these errors were encountered: