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

Fix bug finding implicit namespace packages #1784

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

bbugyi200
Copy link

@bbugyi200 bbugyi200 commented Jul 2, 2021

This PR fixes #1759.

To aid in readability and compile-time / lint-time checks, I have also added type signatures to any functions that I have touched.

@davidhalter: I am looking into how to test these changes now. Any pointers on which test files contain the fixtures / helpers that I will probably need? Nevermind, I figured it out: I added some regression tests to the test_implicit_namespace_package.py test file. I have also verified that these new tests fail on master but pass on this PR branch.

NOTE: I later realized that the jedi/inference/compiled/subprocess/functions.py file did not need any modifications in order to fix this bug; however, since I had already cleaned up that module a bit (e.g. by adding type annotations and removing dead code) and understanding what that module does was probably the biggest hurdle in fixing this bug, I have decided to keep the changes to that module in this PR. If the reviewer disagrees, the changes to that module can be reverted without affecting this bug-fix.

@davidhalter
Copy link
Owner

BTW: my comment is still relevant for this to get merged.

@bbugyi200
Copy link
Author

bbugyi200 commented Oct 6, 2021

BTW: my comment is still relevant for this to get merged.

@davidhalter What comment are you referring to?

@davidhalter
Copy link
Owner

You can see it above, it's Pending.

@PeterJCLaw
Copy link
Collaborator

@davidhalter I don't think there's any visible review comments from you on this PR, are you sure you've submitted them? (If GitHub's UI says it's "Pending" in an orange box I think that means it's pending submission [i.e: a draft comment] rather than pending being addressed).

Copy link
Owner

@davidhalter davidhalter left a comment

Choose a reason for hiding this comment

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

Oh good I'm so sorry. It was really stupid of me to not finish the review.

I really thought that it said "pending", because @bbugyi200 did not change anything.

Thanks for pointing that out @PeterJCLaw.

def import_module(
inference_state: "InferenceState",
import_names: Sequence[str],
parent_module_value: Any,
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove the Any hints, they are pretty much useless (and also wrong).

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

Successfully merging this pull request may close these issues.

Jedi only recognizes first of intersecting implicit namespace packages on PYTHONPATH
3 participants