-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
Reducing parallelism for the cost of a minute sounds fine to me. Good call. |
My 2nd commit successfully eliminated the E0402 error triggered by numpy_op_signature.py. So it seems that the jobs==1 setting generates many more errors than jobs==N. For our codebase, it introduced too-many-lines, duplicate-code and cyclic-import errors. I could see how the duplicate-code and cyclic-import errors might be turned off with jobs=N, since one really needs a view of the entire codebase to report all errors correctly. I'm not sure why suddenly too-many-lines errors are cropping up, but it isn't in the scope of this PR to fix our in-some-cases massive modules. Bottom line: with my third commit, I've disabled too-many-lines, duplicate-code and cyclic-import, and now pylint --jobs=1 is passing. I'll trigger the CI again to gain some confidence in the solution. Removing WIP. Please review. |
@@ -19,6 +19,7 @@ | |||
|
|||
import sys | |||
import warnings | |||
import inspect |
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.
Thanks for putting the efforts on taming pylint. I'm curious why this reorganization of the code would make the pylint error disappear?
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.
So, first I should mention that as I developed the PR on my local machine, I was seeing slightly different pylint output than the upstream CI. This could be due to a different pylint version. In the comment that follows, I'll refer to the pylint command I posted above in the PR description as <pylint_cmd>
:
With the import inspect
statement in its original location, I saw:
$ <pylint_cmd> | grep numpy_op_signature
************* Module mxnet.numpy_op_signature
python/mxnet/numpy_op_signature.py:C0415:63,4: _register_op_signatures: Import outside toplevel (inspect)
With the import inspect
statement moved, no such output line was generated. Since I was touching the file numpy_op_signature.py anyway to eliminate the E0402 error, I thought I'd make the file totally clean w.r.t pylint by moving the import inspect
.
Introducing the line op_module = root_module
was the fix that really mattered (eliminated the E0402 error). Since it didn't change the logic of the code materially, I view this as working around the quirks of pylint.
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.
Indeed, pylint is pinned in some cases inside the ci folder:
install/requirements
30:pylint==2.3.1; python_version >= '3.0'
We should use just one version of pylint...
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.
CI appears to pull in pylint 2.3.1. The most current pylint is 2.4.2.
too-many-statements, | ||
too-many-lines, | ||
duplicate-code, | ||
cyclic-import |
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.
Is cyclic import not a valid thing to consider?
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.
Good point, however there are over 90 cyclic-import errors reported. Analyzing the python software architecture and possibly refactoring it to eliminate cyclic imports is beyond the scope of this PR. I'll file an issue to see if one of the python major code owners will look into this.
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.
Sounds good, thanks
* Change pylint parallel jobs from 8 to 1 * Non-functional tweeks to keep pylint happy * Disable pylint too-many-lines, duplicate-code, cyclic-import * Trigger CI * Trigger CI * Fighting unrelated CI failures. Trigger CI. * Fighting unrelated CI failures. Trigger CI.
Description
As reported in #16401, the pylint check performed by the 'sanity' CI runner has been flakey. Toward correcting this, the planned steps of this PR are:
If others want to jump in to diagnose the pylint issues, the CI command is:
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments