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

[__implements__] Remove everything related to the rejected PEP245 #8404

Merged
merged 5 commits into from
Mar 8, 2023

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Mar 8, 2023

Type of Changes

Type
🔨 Refactoring

Description

Everything related to the __implements__ construct was removed. It was based on PEP245
that was proposed in 2001 and rejected in 2006. It includes everything in pylint.interfaces

Checker should only inherit BaseChecker or any of the other checker types from pylint.checkers.
Reporter should only inherit BaseReporter.

The capability from pyreverse to take it into account when generating diagrams was also removed.

@Pierre-Sassoulas Pierre-Sassoulas added Breaking changes for 3.0 🦤 Maintenance Discussion or action around maintaining pylint or the dev workflow labels Mar 8, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.0.0 milestone Mar 8, 2023
@DudeNr33
Copy link
Collaborator

DudeNr33 commented Mar 8, 2023

For pyreverse there is some more code that can be cleaned up together with this.
I can push to this branch tomorrow evening, or if you want to merge beforehand create a follow-up PR.

@Pierre-Sassoulas
Copy link
Member Author

I've done the cleanup, I'm going to push :)

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #8404 (1c93e22) into main (3318aa0) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8404      +/-   ##
==========================================
+ Coverage   95.63%   95.66%   +0.02%     
==========================================
  Files         176      176              
  Lines       18612    18531      -81     
==========================================
- Hits        17799    17727      -72     
+ Misses        813      804       -9     
Impacted Files Coverage Δ
pylint/lint/pylinter.py 95.94% <ø> (-0.07%) ⬇️
pylint/pyreverse/diagrams.py 91.66% <ø> (-0.29%) ⬇️
pylint/reporters/base_reporter.py 91.66% <ø> (-0.65%) ⬇️
pylint/checkers/base_checker.py 94.95% <100.00%> (-0.25%) ⬇️
pylint/interfaces.py 100.00% <100.00%> (+9.52%) ⬆️
pylint/pyreverse/inspector.py 79.69% <100.00%> (+0.04%) ⬆️
pylint/pyreverse/writer.py 98.63% <0.00%> (-1.37%) ⬇️

DanielNoord
DanielNoord previously approved these changes Mar 8, 2023
Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

🚀

DudeNr33
DudeNr33 previously approved these changes Mar 8, 2023
Copy link
Collaborator

@DudeNr33 DudeNr33 left a comment

Choose a reason for hiding this comment

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

There are a few more places in pyreverse that can be cleaned up now, but the important stuff is included and tests adapted, thanks for that!

From the first quick look the following things can be removed as well:

  • DiagramWriter.write_classes --> everything related to implementation links
  • printer.py: NodeType.INTERFACE and EdgeType.IMPLEMENTS, and for the concrete Printer classes the places where those are used

As said I can take a closer look tomorrow and create a follow up PR. Especially the NodeType.INTERFACE is something that as far as I know did not even work as intended, and I would have to take a closer look at it as well.

DanielNoord
DanielNoord previously approved these changes Mar 8, 2023
@Pierre-Sassoulas Pierre-Sassoulas merged commit 358264a into pylint-dev:main Mar 8, 2023
@Pierre-Sassoulas Pierre-Sassoulas deleted the pep245-removal branch March 8, 2023 20:39
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2023

🤖 Effect of this PR on checked open source code: 🤖

Effect on django:
The following messages are no longer emitted:

  1. redefined-variable-type:
    Redefinition of field type from django.db.models.fields.related.OneToOneField to django.forms.widgets.Widget
    https://github.com/django/django/blob/32d4b61c313be5169137047e9fb3668da20a5d89/django/db/models/base.py#L346

Effect on music21:
The following messages are now emitted:

  1. invalid-name:
    Attribute name "id" doesn't conform to '[a-z_][A-Za-z0-9_]{2,30}$' pattern
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/prebase.py#L293
  2. suppressed-message:
    Suppressed 'attribute-defined-outside-init' (from line 3193)
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/base.py#L3193
  3. suppressed-message:
    Suppressed 'attribute-defined-outside-init' (from line 3264)
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/base.py#L3264
  4. too-many-instance-attributes:
    Too many instance attributes (34/20)
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/roman.py#L1394
  5. redefined-variable-type:
    Redefinition of sc3 type from music21.scale.MajorScale to music21.scale.MinorScale
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/scale/test_scale_main.py#L169
  6. suppressed-message:
    Suppressed 'method-hidden' (from line 11551)
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/stream/base.py#L11552

The following messages are no longer emitted:

  1. invalid-name:
    Attribute name "id" doesn't conform to '[a-z_][A-Za-z0-9_]{2,30}$' pattern
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/base.py#L576
  2. useless-suppression:
    Useless suppression of 'attribute-defined-outside-init'
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/base.py#L3193
  3. useless-suppression:
    Useless suppression of 'attribute-defined-outside-init'
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/base.py#L3264
  4. redefined-variable-type:
    Redefinition of fundamental type from django.forms.widgets.Widget to music21.pitch.Pitch
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/pitch.py#L3690
  5. too-many-instance-attributes:
    Too many instance attributes (33/20)
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/roman.py#L1394
  6. redefined-variable-type:
    Redefinition of lastChord type from music21.chord.Chord to django.forms.widgets.Widget
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/analysis/neoRiemannian.py#L435
  7. redefined-variable-type:
    Redefinition of n type from music21.note.Note to music21.note.GeneralNote
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/abcFormat/translate.py#L354
  8. redefined-variable-type:
    Redefinition of sc3 type from music21.scale.MinorScale to music21.scale.MajorScale
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/scale/test_scale_main.py#L163
  9. useless-suppression:
    Useless suppression of 'method-hidden'
    https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/stream/base.py#L11551

Effect on pandas:
The following messages are now emitted:

  1. redefined-variable-type:
    Redefinition of expected type from pandas.core.arrays.numpy_.PandasArray to pandas.core.indexes.base.Index
    https://github.com/pandas-dev/pandas/blob/9b4cffca38cdc77ee83213af521a02508eff0cb1/pandas/_testing/__init__.py#L300

The following messages are no longer emitted:

  1. redefined-variable-type:
    Redefinition of expected type from pandas.core.arrays.period.PeriodArray to pandas.core.indexes.base.Index
    https://github.com/pandas-dev/pandas/blob/9b4cffca38cdc77ee83213af521a02508eff0cb1/pandas/_testing/__init__.py#L300

This comment was generated for commit 1c93e22

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0, 3.0.0a6 Mar 9, 2023
toofar added a commit to qutebrowser/qutebrowser that referenced this pull request Oct 11, 2023
Changelog: https://pylint.pycqa.org/en/latest/whatsnew/3/3.0/index.html#summary-release-highlights

remove `__implements__`:
That attribute is apparently from a rejected PEP. They say to inherit
from BaseChecker, which we are already doing.
pylint-dev/pylint#8404

check_messages -> only_required_for_messages:
Seems straightforward instructions. I haven't actually tested it.
pylint-dev/pylint#8409

remove emptystring extension:
Looks like this has been replaced by https://pylint.readthedocs.io/en/stable/user_guide/messages/convention/use-implicit-booleaness-not-comparison-to-string.html
Which is disabled by default but we have `enable=ALL`, so I guess that means
we indeed have it enabled.

And update changelog URLs.
ivica-prose added a commit to prosehair/pylint_super_not_called_plugin that referenced this pull request Oct 25, 2023
Pylint removed support for this in this PR pylint-dev/pylint#8404
ivica-prose added a commit to prosehair/pylint_super_not_called_plugin that referenced this pull request Oct 26, 2023
Pylint removed support for this in this PR pylint-dev/pylint#8404
karlch added a commit to karlch/vimiv-qt that referenced this pull request Nov 27, 2023
karlch added a commit to karlch/vimiv-qt that referenced this pull request Nov 27, 2023
* Bump pylint from 2.17.5 to 3.0.2 in /misc/requirements

Bumps [pylint](https://github.com/pylint-dev/pylint) from 2.17.5 to 3.0.2.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](pylint-dev/pylint@v2.17.5...v3.0.2)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Pylint checkers: remove __implements__

Was removed in pylint-dev/pylint#8404.

* Pylint: Other fixes for pylint v3.0.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: karlch <[email protected]>
caarmen added a commit to caarmen/pylint-json2checkstyle that referenced this pull request Jan 20, 2024
Remove the `__implements__ = IReporter` to avoid issue #5.

This was removed in pylint in pylint-dev/pylint#8404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking changes for 3.0 🦤 Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants