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

Avoid search paths for ImportChecker when possible #9595

Merged
merged 2 commits into from
May 4, 2024

Conversation

crazybolillo
Copy link
Contributor

If possible it is desirable to look for modules with no context file as it results in no search paths being given to astroid's find_spec(). This makes calls to it more uniform and opens up the possibility of effective caching.

Refs #9310.

Type of Changes

Type
🔨 Refactoring

If possible it is desirable to look for modules with no context file as
it results in no search paths being given to astroid's find_spec(). This
makes calls to it more uniform and opens up the possibility of effective
caching.

Refs pylint-dev#9310.
Copy link

codecov bot commented May 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.82%. Comparing base (3c8be8e) to head (ab5bafd).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9595   +/-   ##
=======================================
  Coverage   95.81%   95.82%           
=======================================
  Files         173      173           
  Lines       18825    18831    +6     
=======================================
+ Hits        18038    18044    +6     
  Misses        787      787           
Files Coverage Δ
pylint/checkers/imports.py 94.47% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

This comment has been minimized.

jacobtylerwalls
jacobtylerwalls previously approved these changes May 4, 2024
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.

Wonderful!

Let's shout about this in a changelog. There's a "performance" fragment type for this.

Also, do you agree this is enough to mark the linked issue as closed?

@crazybolillo
Copy link
Contributor Author

Wonderful!

Let's shout about this in a changelog. There's a "performance" fragment type for this.

Also, do you agree this is enough to mark the linked issue as closed?

I think the cache is needed in astroid but from a pylint point of view then yes, this is probably all that can be done on pylint to fix the issue.

Copy link
Contributor

github-actions bot commented May 4, 2024

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit ab5bafd

@jacobtylerwalls jacobtylerwalls merged commit b19b94b into pylint-dev:main May 4, 2024
44 checks passed
@jacobtylerwalls jacobtylerwalls added this to the 3.2.0 milestone May 4, 2024
@Pierre-Sassoulas
Copy link
Member

Great !

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.

None yet

3 participants