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

Do not use deprecated methods in PyLinter #6293

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

DanielNoord
Copy link
Collaborator

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Write a good description on what the PR does.

Type of Changes

Type
βœ“ πŸ”¨ Refactoring

Description

@DanielNoord DanielNoord added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Apr 13, 2022
@DanielNoord DanielNoord added this to the 2.14.0 milestone Apr 13, 2022
@coveralls
Copy link

coveralls commented Apr 13, 2022

Pull Request Test Coverage Report for Build 2161969338

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 36 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 93.652%

Files with Coverage Reduction New Missed Lines %
pylint/lint/pylinter.py 2 95.08%
pylint/config/option.py 8 75.53%
pylint/config/arguments_manager.py 26 87.19%
Totals Coverage Status
Change from base Build 2161509428: -0.1%
Covered Lines: 15889
Relevant Lines: 16966

πŸ’› - Coveralls

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.

The decrease in coverage makes me think that PyLinter might be used by Plugin lib and that it would be safer to remove that only after the deprecation period.

@DanielNoord
Copy link
Collaborator Author

The decrease in coverage makes me think that PyLinter might be used by Plugin lib and that it would be safer to remove that only after the deprecation period.

See my comment in #5392. I'll take a look at the coverage and see if there are drops that can be fixed, but there is more general problem behind this.

@DanielNoord
Copy link
Collaborator Author

@Pierre-Sassoulas I have fixed the coverage be re-enabling another test (in a hacky way).

The coverage decrease is now due to some inner if statements of some functions not being reached or some validators not being used. This is expected as we decrease the number of calls to optparse functions. Note that we do cover all DeprecationWarnings.

@Pierre-Sassoulas Pierre-Sassoulas merged commit a542164 into pylint-dev:main Apr 13, 2022
@DanielNoord DanielNoord deleted the argparse-optparse-7 branch April 13, 2022 20:47
@cdce8p
Copy link
Member

cdce8p commented Apr 14, 2022

This change seems to cause a major regression. At least for Home Assistant the disable config values aren't loaded anymore. HA uses pyproject.toml for the pylint config if that helps.

To reproduce, it's enough to install the basic HA requirements and run

pylint homeassistant/core.py

@DanielNoord
Copy link
Collaborator Author

Investigating!

@DanielNoord
Copy link
Collaborator Author

This change seems to cause a major regression. At least for Home Assistant the disable config values aren't loaded anymore. HA uses pyproject.toml for the pylint config if that helps.

To reproduce, it's enough to install the basic HA requirements and run

pylint homeassistant/core.py

Did you bisect to this commit? I'm trying to replicate but I'm seeing difference in behaviour in pyenv and virtualenv. Seems like configuration discovery might be broken. Don't immediately see why this commit would cause that, but I'll keep looking.

@cdce8p
Copy link
Member

cdce8p commented Apr 14, 2022

Did you bisect to this commit?

Yes.

I'm trying to replicate but I'm seeing difference in behaviour in pyenv and virtualenv. Seems like configuration discovery might be broken. Don't immediately see why this commit would cause that, but I'll keep looking.

I'm using the stdlib venv module. I also did a pip install -e <path>/pylint beforehand.

@DanielNoord
Copy link
Collaborator Author

Error found! PR incoming πŸ˜„

@Pierre-Sassoulas
Copy link
Member

The fact we merged without detecting the problem is worrying, maybe #5364 would have helped ?

@DanielNoord
Copy link
Collaborator Author

The fact we merged without detecting the problem is worrying, maybe #5364 would have helped ?

We actually had a test for this specific bug but our test was wrong πŸ˜…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants