Skip to content

Add PEP 610 editable import roots#4050

Open
WilliamK112 wants to merge 1 commit into
facebook:mainfrom
WilliamK112:codex/pyrefly-pep610-editable-imports-1843
Open

Add PEP 610 editable import roots#4050
WilliamK112 wants to merge 1 commit into
facebook:mainfrom
WilliamK112:codex/pyrefly-pep610-editable-imports-1843

Conversation

@WilliamK112

Copy link
Copy Markdown

Summary

  • extend the interpreter environment query to scan .dist-info/direct_url.json metadata for PEP 610 editable installs
  • append editable file:// source roots, plus a conventional src/ child when present, to interpreter-derived import paths
  • keep the scan bounded and tolerant of missing, invalid, non-editable, or non-file direct_url metadata
  • add a Windows-runnable regression test that executes the same interpreter query script with a synthetic editable install

Closes #1843.

Test plan

  • cargo +stable-x86_64-pc-windows-gnu fmt --all --check
  • cargo +stable-x86_64-pc-windows-gnu test -p pyrefly_config environment::environment -- --nocapture
  • cargo +stable-x86_64-pc-windows-gnu test -p pyrefly_config
  • cargo +stable-x86_64-pc-windows-gnu check -p pyrefly
  • cargo +stable-x86_64-pc-windows-gnu test -p pyrefly --test pyrefly_lsp_interaction_tests configuration -- --nocapture
  • CLI smoke: flat-layout editable package with only direct_url.json metadata now checks with 0 errors
  • CLI smoke: src/ layout editable package with only direct_url.json metadata now checks with 0 errors

@meta-cla meta-cla Bot added the cla signed label Jul 5, 2026
@github-actions github-actions Bot added the size/l label Jul 5, 2026
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.

Discovering local projects installed in editable mode PEP610

1 participant