Commit 85c086c
committed
fix: support PackageLoader in metaspec sync command
Issue: sync command failed with 'Unexpected loader type' when MetaSpec
was installed in editable mode (pip install -e .).
Root Cause:
- Code only checked for FileSystemLoader
- Generator uses PackageLoader in editable installs
- PackageLoader doesn't have searchpath attribute
Solution:
- Support both FileSystemLoader and PackageLoader
- Use metaspec.__file__ to locate templates for PackageLoader
- Add template directory existence check
- Improve error messages
Impact:
- ✅ Works with: pip install metaspec
- ✅ Works with: pip install -e . (development mode)
- ✅ Works with: uv pip install -e .
Resolves the bug reported in user feedback.1 parent 34df9fa commit 85c086c
1 file changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
124 | 135 | | |
125 | 136 | | |
126 | 137 | | |
| |||
0 commit comments