IMPALA-11951: Add tools for checking/fixing python 3 syntax

This adds the bin/check-python-syntax.sh script, which
runs "python -m compileall" for all python files in
Impala with both python2 and python3. This detects
syntax errors in the python files. This will be
incorporated into precommit once it is clean.

This also adds future to the impala-python virtualenv.
This provides the futurize script (exposed via
impala-futurize), which can be used to automatically
fix some py2/py3 issues. Future also provides the
builtins library, which can provide python 3
functionality on python 2.

Testing:
 - Ran impala-futurize locally
 - Ran the script repeatedly while fixing syntax errors

Change-Id: Iae2c51bc6ddc9b6a04469ee1b8284227fed3bd45
Reviewed-on: http://gerrit.cloudera.org:8080/19550
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Tested-by: Michael Smith <michael.smith@cloudera.com>
This commit is contained in:
Joe McDonnell
2023-02-26 13:04:52 -08:00
parent 2ae0e4139c
commit ff62a4df39
3 changed files with 93 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ flake8 == 3.9.2
contextlib2 == 0.6.0
pathlib2 == 2.3.7.post1
zipp == 1.2.0
future == 0.18.3
gcovr == 4.2
Jinja2 == 2.11.3
MarkupSafe == 1.1.1