Commit db89b6e
committed
feat: add pet-hatch locator for Hatch environments (Fixes #450)
Adds a new pet-hatch crate that detects Hatch-managed virtual environments so they are no longer misclassified as plain Venv by downstream consumers.
Implementation matches Hatch's actual storage layout from src/hatch/env/virtual.py:
- Default storage: <data_dir>/env/virtual/<project_name>/<project_id>/<venv_name> (3 levels deep)
- HATCH_DATA_DIR env var honoured; never silently falls back to platform default when set
\ example from the issue)
- Locator inserted before Venv so Hatch claims its envs first
- 15 unit tests covering layout depth (rejects 2 / 4 levels), HATCH_DATA_DIR semantics, project-local config, and platform defaults1 parent 93285a8 commit db89b6e
8 files changed
Lines changed: 911 additions & 0 deletions
File tree
- crates
- pet-core/src
- pet-hatch
- src
- pet
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments