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

Use absolute import qualified module name for deprecated module check #4678

Merged

Conversation

matusvalo
Copy link
Collaborator

@matusvalo matusvalo commented Jul 6, 2021

Steps

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Description

This PR adjust deprecated module check of from imports to use absolute import name. It helps avoid detecting deprecated
modules in relative imports.

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Related Issue

Closes #4629

@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code labels Jul 6, 2021
@coveralls
Copy link

coveralls commented Jul 6, 2021

Coverage Status

Coverage increased (+0.0006%) to 92.046% when pulling f9cf192 on matusvalo:relative_deprecated_import into 70bd7d7 on PyCQA:main.

@matusvalo
Copy link
Collaborator Author

matusvalo commented Jul 6, 2021

Pending:

  • Tests
  • docstring improvements.

@matusvalo matusvalo marked this pull request as ready for review July 6, 2021 11:38
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

Thank you for this ! I did not know that it was possible to create packages in the functional tests, good to know. (It means we could migrate the old functional test entirely).

@@ -0,0 +1,2 @@
[testoptions]
min_pyver=3.2
Copy link
Member

Choose a reason for hiding this comment

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

This isn't required because the min supported version is python 3.6 anyway. (I'm saying this so you don't have to do it next time, no need to change that :) )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you good to know. I saw that other tests include even older version of python than supported by pylint, so I considered it as a practise to put it there...

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we should probably clean up when we stop supporting Python 3.6, because this is confusing. I don't think anyone will fork to support a lower version of Python than us anyway. I'm going to open an issue.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.9.4 milestone Jul 6, 2021
@Pierre-Sassoulas Pierre-Sassoulas merged commit 0f8212f into pylint-dev:main Jul 6, 2021
@matusvalo matusvalo deleted the relative_deprecated_import branch July 6, 2021 21:24
@matusvalo
Copy link
Collaborator Author

I did not know that it was possible to create packages in the functional tests, good to know.

Me neither, I just tried and it worked :-D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
3 participants