Commit b554a7f
committed
Fix issue #65: Check source directories exist before writing to requirements
When using mxdev -n (no-fetch) or in offline mode, source directories may
not exist yet. Previously, mxdev would write references like '-e ./sources/package'
to requirements-mxdev.txt regardless, causing pip install to fail later.
This fix checks if source directories exist before writing them:
- If directory exists: Write normally (existing behavior)
- If directory doesn't exist: Write as comment with contextual warning
The warning message adapts based on context:
- In offline mode: Mentions offline mode and suggests removing -n and --offline flags
- Normal mode: Suggests removing -n flag to fetch sources
This fixes the mxmake two-stage installation workflow where mxdev -n runs
before sources are checked out.
Changes:
- Update write_dev_sources() to accept State parameter and check path existence
- Add contextual warning messages for missing directories
- Add tests for missing directories and offline mode warnings
- Update existing tests to pass State parameter
Fixes #651 parent 52e7d66 commit b554a7f
File tree
4 files changed
+390
-206
lines changed- .claude
- src/mxdev
- tests
4 files changed
+390
-206
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
214 | 220 | | |
215 | 221 | | |
| 222 | + | |
216 | 223 | | |
217 | 224 | | |
218 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
222 | 233 | | |
223 | 234 | | |
224 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
225 | 256 | | |
226 | | - | |
227 | | - | |
228 | 257 | | |
229 | 258 | | |
230 | 259 | | |
| |||
289 | 318 | | |
290 | 319 | | |
291 | 320 | | |
292 | | - | |
| 321 | + | |
293 | 322 | | |
294 | 323 | | |
0 commit comments