Skip to content

Make --ignore-missing-imports less strict #5228

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

Merged
merged 4 commits into from
Jun 21, 2018

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Jun 17, 2018

Fixes #5226

Currently, import existing_package.non_existing_mod (with --ignore-missing-imports) allows subsequent

from existing_package import non_existing_mod
x = non_existing_mod.f()

but doesn't allow a direct call

x = existing_package.non_existing_mod.f()

With this change both are allowed. This doesn't solve the problem of partial packages, but makes --ignore-missing-imports more consistent with the flag name IMO.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Looks good to me. This makes import semantics across different forms of imports more consistent and predictable.

Have you verified that doesn't break anything in internal Dropbox codebases?

@ilevkivskyi
Copy link
Member Author

Have you verified that doesn't break anything in internal Dropbox codebases?

Not yet, I will check this in next few hours, I will merge if testpr passes.

@gvanrossum
Copy link
Member

gvanrossum commented Jun 18, 2018 via email

@ilevkivskyi ilevkivskyi changed the title Fix missing imports Make --ignore-missing-imports less strict Jun 18, 2018
Copy link
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

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

LGTM

@msullivan
Copy link
Collaborator

Is there any documentation that should be updated along with this?

@ilevkivskyi
Copy link
Member Author

Is there any documentation that should be updated along with this?

This is a good idea, I will add some docs.

@ilevkivskyi
Copy link
Member Author

I was finally able to check, this passes testpr.

@ilevkivskyi ilevkivskyi merged commit 4026cb8 into python:master Jun 21, 2018
@ilevkivskyi ilevkivskyi deleted the fix-missing-imports branch June 21, 2018 23:47
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.

5 participants