Skip to content

Follow relative imports in site_packages in gen_source_db#4

Open
msullivan wants to merge 1 commit intofacebook:mainfrom
msullivan:relative-imports
Open

Follow relative imports in site_packages in gen_source_db#4
msullivan wants to merge 1 commit intofacebook:mainfrom
msullivan:relative-imports

Conversation

@msullivan
Copy link
Copy Markdown
Contributor

When processing modules in site_packages, track the current package
and use that to resolve relative imports.

We don't bother doing this for packages in the project because they
are currently all collected.

@meta-cla meta-cla Bot added the cla signed label Apr 17, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 20, 2026

@brittanyrey has imported this pull request. If you are a Meta employee, you can view this in D101645305.

@brittanyrey brittanyrey self-assigned this Apr 20, 2026
Copy link
Copy Markdown
Contributor

@brittanyrey brittanyrey left a comment

Choose a reason for hiding this comment

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

Hmm, it looks like this PR pulls in foldhash as a Cargo.lock dep...

@martindemello
Copy link
Copy Markdown
Contributor

the cargo.lock diff seems accidental, since the code isn't using foldhash anywhere. could you revert that? the rest looks good.

@msullivan
Copy link
Copy Markdown
Contributor Author

Sorry, the Cargo.lock changes get done automatically by cargo, I think because pyrefly gets updated without Cargo.lock being rebuilt

Comment thread src/commands/gen_source_db.rs Outdated
@msullivan
Copy link
Copy Markdown
Contributor Author

(I rebased on top of #6, so the PR has some extra noise until that goes in; I could undo and rebase the other direction if you'd prefer, or if you end up not wanting to approve #6)

@martindemello
Copy link
Copy Markdown
Contributor

#6 looks great to me, we can wait till that goes in and then rebase and land this one

@msullivan msullivan force-pushed the relative-imports branch 2 times, most recently from 5ffbf70 to 02d286c Compare April 21, 2026 21:32
When processing modules in site_packages, track the current package
and use that to resolve relative imports.

We don't bother doing this for packages in the project because they
are currently all collected.
@msullivan
Copy link
Copy Markdown
Contributor Author

Alright I think this is all good and rebased

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