Skip to content

Always use the suggestion mode for no-member / c-extension-no-member #9962

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

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Sep 24, 2024

Type of Changes

Type
βœ“ πŸ”¨ Refactoring

Description

There's no reason to not suggest, so we can remove the option too in the spirit of simplification. The performance of no-member were recently improved in #10277

This comment has been minimized.

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.

I agree with the change! Do we need tests?

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

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

Principle makes sense to me.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the remove-suggestion-mode-option-we-always-suggest branch from b370363 to 7a7170f Compare October 14, 2024 20:21

This comment has been minimized.

Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Dec 1, 2024
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the remove-suggestion-mode-option-we-always-suggest branch from 7a7170f to 8e103a6 Compare December 1, 2024 20:13

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas changed the title (proposal) Always use the suggestion mode for no-member / c-extension-no-member Always use the suggestion mode for no-member / c-extension-no-member Dec 1, 2024

This comment has been minimized.

This comment has been minimized.

Pierre-Sassoulas added a commit that referenced this pull request Mar 30, 2025
_is_c_extension already checks if owner is a Module

See #9962 (comment)

Caching start to make sense in _similar_name

See #9962 (comment)
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the remove-suggestion-mode-option-we-always-suggest branch from d2abf8d to bf2fcc7 Compare March 30, 2025 11:33

This comment has been minimized.

@@ -172,6 +172,7 @@ def _string_distance(seq1: str, seq2: str, seq1_length: int, seq2_length: int) -
return row[seq2_length - 1]


@lru_cache(maxsize=256)
Copy link
Member

Choose a reason for hiding this comment

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

Can we add this to clear_lru_caches()?

Copy link
Member Author

Choose a reason for hiding this comment

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

This created a circular import between typecheck and utils so I created a new file.

Pierre-Sassoulas added a commit that referenced this pull request Mar 30, 2025
_is_c_extension already checks if owner is a Module

See #9962 (comment)

Caching start to make sense in _similar_name

See #9962 (comment)
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the remove-suggestion-mode-option-we-always-suggest branch from bf2fcc7 to 32b7046 Compare March 30, 2025 15:56

This comment has been minimized.

@Pierre-Sassoulas
Copy link
Member Author

Blocked by #10320

_is_c_extension already checks if owner is a Module

See pylint-dev#9962 (comment)

Caching start to make sense in _similar_name

See pylint-dev#9962 (comment)

We had to create a clean_lru_cache file to prevent a circular import.
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the remove-suggestion-mode-option-we-always-suggest branch from 32b7046 to 87c6d0c Compare March 30, 2025 19:34
@Pierre-Sassoulas
Copy link
Member Author

(I won't be able to work on this caching issue for the next 3 days as I'll be on mobile.)

@DanielNoord
Copy link
Collaborator

Is this a caching issue? Isn't it just a test failure?

@Pierre-Sassoulas
Copy link
Member Author

Pierre-Sassoulas commented Mar 30, 2025

The failing test is test_generate_rcfile nothing happens locally if I try to regenerate the rc file. (The error message is horrendous, I could try to make it more like the message when the doc is not up to date)

This comment has been minimized.

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.

The issue was that theses tests use sys.executable (or whatever it is called) and then call the globally installed pylint. Without the cache miss it means that this will keep inserting suggestion-mode in the generated config as the globally installed pylint still has it in its options.

Fixed it by invalidating the cache.

We should probably reconsider those tests.

@DanielNoord DanielNoord merged commit 7422cf3 into pylint-dev:main Mar 30, 2025
35 of 36 checks passed
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 8eb2dbf

@DanielNoord
Copy link
Collaborator

@Pierre-Sassoulas Both main and #10287 failed on the same error in PyPy. Considering it failed when we tried to add it and I really don't think there is a lot of value of supporting PyPy: at what point we do just declare it unmaintained?

@Pierre-Sassoulas Pierre-Sassoulas deleted the remove-suggestion-mode-option-we-always-suggest branch March 31, 2025 04:22
@Pierre-Sassoulas
Copy link
Member Author

We're already skipping some tests on pypi, we can skip more. There seem to be some users as evidenced by the MR opened to add 3.11 pypy support you linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants