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

CircleCI: Run flake8 tests on both Python 2 and Python 3 #8878

Merged
merged 10 commits into from
Aug 12, 2019

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jun 27, 2019

The flake8 tests on Python 3 are temporarily run with --exit-zero so we can see our porting progress without failing the builds.

Thank you for submitting a pull request!

If this is your first PR, make sure to add yourself to AUTHORS.

cclauss added 2 commits June 27, 2019 18:50
The flake8 tests on Python 3 are _temporarily_ run with __--exit-zero__ so we can see our porting progress without failing the builds.
@kripken
Copy link
Member

kripken commented Jul 1, 2019

Thanks @cclauss! Good idea.

I think the old flake8 may need to be removed from the config file, as it seems to still be waiting for that in the CI info here.

Also please add yourself to AUTHORS.

@kripken
Copy link
Member

kripken commented Jul 1, 2019

Btw, it may be best to run the python2 and 3 tests in a single circleCI job - as it's fast enough, and avoids any constant job overhead.

@cclauss
Copy link
Contributor Author

cclauss commented Jul 1, 2019

If we keep them separate, it will be easier to drop Python 2 in ~184 days.

@cclauss
Copy link
Contributor Author

cclauss commented Jul 1, 2019

Where exactly are the required vs. optional tests stored? I.E. In which file does the old flake8 need to be removed? Thx.

@cclauss
Copy link
Contributor Author

cclauss commented Jul 1, 2019

I added myself to authors in #8876

@sbc100
Copy link
Collaborator

sbc100 commented Jul 1, 2019

If we keep them separate, it will be easier to drop Python 2 in ~184 days.

I'm a big fan of the python3 upgrade, and I even opened the bug for that: #7198.

However, I don't think that the ending of upstream support for python2 is going to be the forcing factor here. Emscripten has a complex set of objectives and a diverse set of users. For example we have used on ancient version of OSX who have a system python that is years old already, so we already support customers on unsupported pythons.

So yes, by all means lets work towards removing python2, but I don't see that specific date as the main driver here.

@sbc100
Copy link
Collaborator

sbc100 commented Jul 1, 2019

I agree with @kripken.. lets just add it to the existing flake8 job. I think it will actually make removing it easier... or at least the patch will be smaller to remove it.

@kripken
Copy link
Member

kripken commented Jul 2, 2019

I think those test errors were temporary breakage from earlier, please merge in latest incoming to here.

Otherwise this looks good to me. I assume the --exit-zero is intentional, as mentioned in the first comment (that is, it is temporary but will exist beyond this one PR)?

@kripken
Copy link
Member

kripken commented Jul 8, 2019

To fix the tests, I think we need to merge origin/incoming into here, to get the latest changes there (just re-running tests won't work since it's running the same old code from before, that has been fixed meanwhile in upstream).

@kripken
Copy link
Member

kripken commented Jul 8, 2019

Btw, does anyone know if there a way for project maintainers to do such a merge themselves? I've seen other projects have an option "let other people add commits" but I'm not sure how to enable that in this repo.

@kripken
Copy link
Member

kripken commented Jul 8, 2019

Oh, it sounds like the PR creator can allow maintainers to add commits, but no one else, https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork So that might not help us much it still requires a manual step for PR submitters for us to help merge incoming in. But whatever people prefer to do is fine with me.

@quantum5 quantum5 requested review from sbc100 and kripken August 10, 2019 00:24
@cclauss
Copy link
Contributor Author

cclauss commented Aug 10, 2019

144 days until Python 2 end of life.

1     E211 whitespace before '('
55    E722 do not use bare 'except'
10    E741 ambiguous variable name 'l'
3     E999 SyntaxError: invalid syntax
6     F632 use ==/!= to compare str, bytes, and int literals
5     F821 undefined name 'xrange'
3     F841 local variable 'e' is assigned to but never used
40    W504 line break after binary operator
97    W605 invalid escape sequence '\s'
7     W606 'async' and 'await' are reserved keywords starting with Python 3.7

The E999 syntax errors must be fixed to be Python 3 compatible. #9200 and #9201
The W606 errors must be fixed to be Python >= 3.7 compatible.
The F821 errors are worthy of investigation.
The E722 issues are described at https://realpython.com/the-most-diabolical-python-antipattern

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but @sbc100 knows the most about this.

@@ -242,9 +242,12 @@ jobs:
name: install pip
command: |
apt-get update -q
apt-get install -q -y python-pip
apt-get install -q -y python-pip python3-pip
- run: pip install flake8==3.4.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably upgrade this version too.. (otherwise we could end up with conflicting warnings). Maybe either upstate it as part of this CL or open a separate one if you prefer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like #8877 was created for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8877 only ran flake8 on legacy Python.

@quantum5 quantum5 merged commit 5e0e784 into emscripten-core:incoming Aug 12, 2019
@cclauss cclauss deleted the patch-2 branch August 12, 2019 23:39
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
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

Successfully merging this pull request may close these issues.

4 participants