Skip to content

Unpin pylint version and fix some lint warnings - #484

Merged
weiji14 merged 15 commits into
masterfrom
unpin_pylint_version
Jun 27, 2020
Merged

Unpin pylint version and fix some lint warnings#484
weiji14 merged 15 commits into
masterfrom
unpin_pylint_version

Conversation

@weiji14

@weiji14weiji14 commented Jun 21, 2020

Copy link
Copy Markdown
Member

Description of proposed changes

Not sure why pylint was pinned to 2.2.2 in #383, but it's broken and we'll need to update to 2.3.0 or newer (see pylint-dev/astroid#649). Using 2.2.2 will give the following error:

 AttributeError: 'Import' object has no attribute 'infer_name_module'

Will also fix some lint warnings in this PR. I've refreshed the .pylintrc file for pylint v2.5.3 by running:

pylint --generate-rcfile > .pylintrc

and then manually kept some old PyGMT specific settings from earlier PRs (e.g. #73).

  • jobs=4
  • max-module-lines=2000
  • max-args=10
  • max-attributes=10
  • good-names=i,j,k,ex,Run,_,w,e,s,n,x,y,z

Also added back 'attribute-defined-outside-init' and 'bad-continuation' to the disable list, the latter is to fit in with black (see psf/black#48).

References:

Fixes #

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

@weiji14weiji14 added the maintenance Boring but important stuff for the core devs label Jun 21, 2020
@seisman

Copy link
Copy Markdown
Member

pylint-dev/astroid#649 (comment)

The reason we pin pylint is that new versions often introduce new types of errors, and we don't want our CI to break due to these new errors. For example 2.3.0 introduces a new "no-else-raise" error.

I guess @leouieda pinned pylint for the same reason.

Run v2.5.3 of pylint: `pylint --generate-rcfile > .pylintrc`, and then manually keeping some old PyGMT specific settings. E.g. jobs=4; max-module-lines=2000; max-args=10; max-attributes=10; good-names=i,j,k,ex,Run,_,w,e,s,n,x,y,z. Add back 'attribute-defined-outside-init' and 'bad-continuation' to the disable list, the latter is to fit in with black (see psf/black#48).
Allow importing certain modules outside of toplevel.
@vercel
vercelBot temporarily deployed to Preview June 24, 2020 00:44 Inactive
@weiji14
weiji14 requested a review from a teamJune 26, 2020 03:12
Comment threadpygmt/helpers/utils.py
@seisman

Copy link
Copy Markdown
Member

Please merge the master branch in and see if the CI pass (still 43 failures).

See https://stackoverflow.com/a/61139278.
Co-Authored-By: Dongdong Tian <seisman.info@gmail.com>
@seisman

Copy link
Copy Markdown
Member

There is still one warning for me:

pylint pygmt setup.py
************* Module pygmt
pygmt/__init__.py:42:4: C0415: Import outside toplevel (clib) (import-outside-toplevel)

but I'm using pylint 2.4.4

Comment thread.pylintrc Outdated
So that both pylint 2.4.4 and 2.5.3 will be happy.
@weiji14
weiji14 merged commit 0afaa69 into masterJun 27, 2020
@weiji14
weiji14 deleted the unpin_pylint_version branch June 27, 2020 23:11
@weiji14weiji14 added this to the 0.1.x milestone Jun 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenanceBoring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@weiji14@seisman