-
Notifications
You must be signed in to change notification settings - Fork 305
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
Enable Pylint in CI and fix its errors #311
Conversation
CI is failing, presumably because we need to pick a different version of pylint:
|
@aswaterman yes, you are absolutely correct here. Actually, as |
Ah that's unfortunate. I think the simplest and best solution is just to skip Pylint on everything except the latest Python. There's no reason to run it on older versions because it doesn't use the current Python version to dictate what checks to run. We can do the same for Pyright. |
.pylintrc
Outdated
@@ -0,0 +1,31 @@ | |||
[MAIN] | |||
py-version = 3.6.0 |
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.
@Timmmm I think we could use py-version
as 3.9.0
.
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 think we want 3.6.0. According to this it just hides suggestions for features that are only supported in newer versions of Python, so it should be set to the oldest version we support. In other words if we set it to 3.9.0 it will tell us to do some things that are not supported in 3.6.0, so we can't do them, like using the walrus operator for example.
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.
Ah wait I didn't see the discussion about increasing the minimum version to 3.9 ( 🎉 ). In that case I agree. I'll update the Pyright version too.
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.
Actually, as per the tagged PRs earlier, we would not be using the older versions of Python
that are deprecated and reached its EOL. Hence, we are only supporting this repository to the latest and the supported versions of Python
.
And in #299 , we found that version python 3.6
is deprecated and reached its EOL, due to which we agreed not to support versions that are deprectaed by Python community itself.
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.
@Timmmm I think by force pushing by your end deleted my commit to use 3.9 version and as a consequence my authorship to that commit.
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's OK
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #311 +/- ##
==========================================
+ Coverage 95.87% 96.53% +0.65%
==========================================
Files 10 10
Lines 752 750 -2
==========================================
+ Hits 721 724 +3
+ Misses 31 26 -5 ☔ View full report in Codecov by Sentry. |
Use explicit imports rather than wildcards. This is more maintainable.
The main fixes were: * Specify encoding for all file opens. By default it depends on environment variables which is bad. * Use `with` to open files. Otherwise they don't necessarily get closed. There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
@aswaterman I have configured the I think the CI passes now. |
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.
Let’s run with it.
* Remove wildcard imports Use explicit imports rather than wildcards. This is more maintainable. * Enable Pylint in CI and fix its errors The main fixes were: * Specify encoding for all file opens. By default it depends on environment variables which is bad. * Use `with` to open files. Otherwise they don't necessarily get closed. There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
* Remove wildcard imports Use explicit imports rather than wildcards. This is more maintainable. * Enable Pylint in CI and fix its errors The main fixes were: * Specify encoding for all file opens. By default it depends on environment variables which is bad. * Use `with` to open files. Otherwise they don't necessarily get closed. There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
* Remove wildcard imports Use explicit imports rather than wildcards. This is more maintainable. * Enable Pylint in CI and fix its errors The main fixes were: * Specify encoding for all file opens. By default it depends on environment variables which is bad. * Use `with` to open files. Otherwise they don't necessarily get closed. There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
The main fixes were:
with
to open files. Otherwise they don't necessarily get closed.There were also a few minor things like using
enumerate
, not using objects as default arguments, etc. In some cases I slightly refactored the code.Note, this PR includes #310 because one of Pylint's checks is to not use wildcard imports. I suggest we merge that one first, then I'll rebase this.