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

Handling imports from sibling modules #1027

Merged
merged 1 commit into from
Jan 28, 2023
Merged

Conversation

linzhp
Copy link
Contributor

@linzhp linzhp commented Jan 28, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

When a Python module imports another one in the same package, it can use the file name without the directory names. When Gazelle generate the targets, they are either in the same target or in sibling targets already depending on each other. However, Gazelle still tries to resolve them, even though no dependency resolution is needed

What is the new behavior?

Identify imports in sibling modules and ignore them.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@linzhp linzhp requested a review from f0rmiga as a code owner January 28, 2023 04:39
@f0rmiga
Copy link
Collaborator

f0rmiga commented Jan 28, 2023

Thanks! This was on my TODO list. I'm glad you got it solved!

@linzhp
Copy link
Contributor Author

linzhp commented Jan 28, 2023

Thanks for fast review!

@f0rmiga f0rmiga merged commit 82c8f0a into bazelbuild:main Jan 28, 2023
@linzhp linzhp deleted the sibling branch January 28, 2023 04:46
ianpegg-bc pushed a commit to ianpegg-bc/rules_python that referenced this pull request May 12, 2023
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.

None yet

2 participants