facebook / facebook/pyrefly

Pytest project structure not supported by Pyrefly import root heuristics

Open
#1,486 2 comments 2 reactions 1 assignee Claimed by @iamhaseebn View on GitHub
configuration help wanted
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

Pytest projects typically have two checked directories:
- `src/`
- `src/`'s import root is itself. All files in `src/` import from `src/`
- `tests/` (maybe `test/`?)
- `tests/` import root is its parent directory. We should support this in Configs, since right now the default config won't work at all in this directory.

We should do one of:
- get rid of import root (or just use it for debugging stuff) and move its information into `search_path`
- make import root an enum with a variant that can possibly work with multiple roots (one primary and one secondary for tests)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.