Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure due to python syntax error #2378

Open
NAThompson opened this issue Jul 14, 2020 · 1 comment
Open

Build failure due to python syntax error #2378

NAThompson opened this issue Jul 14, 2020 · 1 comment

Comments

@NAThompson
Copy link
Contributor

NAThompson commented Jul 14, 2020

Beginning in this build, we have a build failure:

Checking formatting for commit range: 937ff001ffa2 6e3d1b3fb0dc

./source/utils/bp4dbg/bp4dbg.py:40: [E999] SyntaxError: invalid syntax

./source/utils/bp4dbg/adios2/bp4dbg/metadata.py:141: [E999] SyntaxError: invalid syntax

./source/utils/bp4dbg/adios2/bp4dbg/data.py:126: [E999] SyntaxError: invalid syntax

The command "${TRAVIS_BUILD_DIR}/scripts/travis/run.sh" exited with 1.

Some low-effort triaging suggests that this might be the issue.

@NAThompson
Copy link
Contributor Author

Ok, I can now explicitly reproduce:

$ pip2 install flake8
$ flake8 bp4dbg/bp4dbg.py
bp4dbg/bp4dbg.py:8:1: E302 expected 2 blank lines, found 1
bp4dbg/bp4dbg.py:40:68: E999 SyntaxError: invalid syntax

However, we see that the first line of bp4dbg.py explicitly reads

#!/usr/bin/env python3

So the problem has been caused by running a python2 linter on python3 code.

There are two options: Either drop the requirement of using python3 in these files, and go through and slap the from __future__ import print_function all over, or use the Python3 linter on python3 code. The fix in #2379 takes the latter approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant