-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25962][BUILD][PYTHON] Specify minimum versions for both pydocstyle and flake8 in 'lint-python' script #22963
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
Conversation
| flake8 . --count --select=E901,E999,F821,F822,F823 --max-line-length=100 --show-source --statistics | ||
| flake8_status="${PIPESTATUS[0]}" | ||
| # Check by flake8 | ||
| if hash "$FLAKE8BUILD" 2> /dev/null; then |
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.
I manually tested each branch.
|
Test build #98545 has finished for PR 22963 at commit
|
| FLAKE8BUILD="flake8" | ||
| MINIMUM_FLAKE8="3.4.0" | ||
|
|
||
| SPHINXBUILD=${SPHINXBUILD:=sphinx-build} |
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.
@shaneknapp and @cloud-fan, it seems flake8 does work but indeed the problem was compatibility with pycodestyle within flake8 itself.
Our script uses pycodestyle 2.4.0 but it's manually downloaded. So, Jenkins's pycodestyle might be different or old and this might be the actual root cause.
I locally tested with latest pycodestyle and flake 3.6.0 and it worked.
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.
BTW, i tested flake8 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0 and 3.6.0 while I am here.
|
Test build #98546 has finished for PR 22963 at commit
|
| fi | ||
|
|
||
| # stop the build if there are Python syntax errors or undefined names | ||
| flake8 . --count --select=E901,E999,F821,F822,F823 --max-line-length=100 --show-source --statistics |
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.
BTW, it was never a good idea to use external executable program directly without any check.
|
Test build #98547 has finished for PR 22963 at commit
|
|
Test build #98548 has finished for PR 22963 at commit
|
|
cc @srowen, @holdenk and @rekhajoshm |
|
Test build #98549 has finished for PR 22963 at commit
|
|
Merged to master. |
|
Thanks, @srowen and @dongjoon-hyun. |
|
sorry to jump in late on this, but i just wanted to check in on some of this stuff...
currently installed packages + versions: |
|
ok, i missed that previous comment about flake8 and pycodestyle version incompatibility. since we're running flake8 3.50, i agree that this could be causing problems w/pycodestyle running properly: i'll bump flake8 to 3.6 on all of the workers, and then bump pycodestyle to 2.4.0 |
|
interesting. from the flake8 webpage: we're testing flake8 w/python 3.4.5 on the centos workers, and soon to be python 3.5 everywhere. this means that flake8 probably hasn't been behaving properly since the get-go. also, this PR sets the flake8 version to 3.6, which means we should be testing against python3.6... i was only planning on bumping the python version from 3.4 -> 3.5, however. what's also confusing is that there are version of flake8 3.6.0 for python2.7, 3.6 and 3.7. i think we have some serious, and heretofore unknown, version incompatibilities in our python testing environment. what i'm going to do/test:
(edited due to getting confused w/so many version numbers) |
|
I don't have the context here to have a strong opinion, but, it seems like we should make the test env setup self-contained if possible, to avoid dependencies on and maintenance of the build env. After all others need to run these tests too. To that end, downloading and installing particular versions seems reasonable (if they're not already installed at the right version?) Is that hard? Whatever makes this more robust and needs less maintenance from you sounds good. I think you're welcome to clean up the script as you like too. |
|
pydocstyle tests passed w/o issue btw: this is on ubuntu w/python 3.5, flake8 3.6.0, pydocstyle 3.0.0 and pycodestyle 2.4.0. i also updated all of the centos jenkins workers to have flake8 3.6.0 and pycodestyle 2.4.0. recent PRB builds have passed w/o issue. |
it should be reasonable to download a binary as we do for pycodestyle. i'll look around and see what i can find.
i will absolutely be taking a long, hard look at lint-python... |
|
orthogonal to this PR, but just as an FYI: |
@shaneknapp - That is expected, as for now, dev/tox.ini has all checks in ignore section for pydocstyle. thanks. |
|
OMG, I don't know why I missed these comments. I will read it tomorrow (now it's 6 am and I could get sleep .. ) |
|
I also agree with @srowen's (#22963 (comment)) . Will try to have some time to take a look for a help soon. |
|
i checked, and the only one we can seemingly download independently is pycodestyle. |
…tyle and flake8 in 'lint-python' script ## What changes were proposed in this pull request? This PR explicitly specifies `flake8` and `pydocstyle` versions. - It checks flake8 binary executable - flake8 version check >= 3.5.0 - pydocstyle >= 3.0.0 (previously it was == 3.0.0) ## How was this patch tested? Manually tested. Closes apache#22963 from HyukjinKwon/SPARK-25962. Authored-by: hyukjinkwon <[email protected]> Signed-off-by: hyukjinkwon <[email protected]>
What changes were proposed in this pull request?
This PR explicitly specifies
flake8andpydocstyleversions.How was this patch tested?
Manually tested.