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
Use Python3 compatible syntax. #126
Conversation
thanks! that was quick :) can you please run |
We will add this in the documentation on how to do linting and formatting. |
Looking into getting that set up -- is there a chance of a CI environment that will run/verify these? The setup scripts for |
Not yet -- we have a CI environment but right now it's lacking lint capability. I just filed #127 and hope to get it added very soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming that the removal of the print statement in src/python/tests/appengine/libs/handler_test.py is acceptable.
/gcbrun |
fails in integration tests, can only be triggered by us until CI is up hopefully next week. but usually as soon as you upload, we will see it and add a trigger. here is the failure. Step #1: ====================================================================== |
That's amazing. I've done a lot of these, and I've never seen that particular error. |
@alex What tool did you use? Futurize, Modernize, etc.? |
/gcbrun |
1 similar comment
/gcbrun |
Could you please merge the latest changes from master into this PR? We added lint support in our CI but this PR is still based on an older revision which didn't have that :) |
This code continues to run correctly under Python2. Changes include: - Modernized octal literals - Print as a function - 'as' syntax for handling exceptions - Remove of 'L' long suffixes
/gcbrun |
This PR looks like a good place to discuss Python :-) I've just added ClusterFuzz to LGTM (https://lgtm.com/projects/g/google/clusterfuzz/alerts/?mode=tree) and it currently thinks that ClusterFuzz is a Python3 project. Would it be OK if I added a file named By the way, it's also possible to enable automatic code review if that sounds interesting. |
@evverx - is LGTM.com any good for python code ? what sort of issues does it find ? i thought it would make sense for more native c/c++ code. |
@evverx For legacy Python, the .lgtm.yml file should contain:
|
@inferno-chromium all the rules can be found at https://lgtm.com/search?q=language%3Apython&t=rules, but as far as I can tell, out of the box it can't find anything that can't be found with other tools and if that's already covered by the CI, then automatic code review will be redundant. I think adding |
@cclauss I have been bothering the team behind LGTM for about a year :-) and among other things they told me how to enforce python2. But thank you! |
@evverx - sure go ahead and submit a pr for python 2. |
@evverx Actually, Abhishek and I spoke. No need to do a PR (sorry!). We'll think about this and add this file if we decide we want to use LGTM. Thanks for the help! |
@jonathanmetzman the project is already there and, hopefully, will be analyzed continuously anyway. In the long term it's probably better to stick to python3 there. Plus after this PR is merged and half the alerts are gone, the graphs will look really cool :-) |
@alex did you manage to get
Also, there is now a conflict so you'll need to resolve them :/ |
@alex Could you please add the two spaces to placate the linter? |
This is done in 6738dd6 closing. |
This code continues to run correctly under Python2.
Changes include: