Fix issue #65: Check source directories exist before writing to requirements #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #65 - mxdev now checks if source directories exist before writing them to requirements-mxdev.txt, with different behavior based on offline mode.
Problem
When using
mxdev -n(no-fetch) or in offline mode, source directories may not exist yet. Previously, mxdev would write references like-e ./sources/packageto requirements-mxdev.txt regardless, causing pip install to fail with "directory does not exist" errors.This breaks the mxmake two-stage installation workflow:
mxdev -nto generate requirements file-e ./sources/packageeven though sources don't existSolution
Modified
write_dev_sources()to check if source directories exist with different behavior based on mode:Offline Mode (expected missing sources)
Non-Offline Mode (unexpected missing sources = fatal error)
This prevents silent failures when sources fail to checkout.
Changes
write_dev_sources()to accept State parameter and checkPath(package["path"]).exists()# -e ./sources/package # mxdev: source not checked outTesting
✅ All write_dev_sources tests pass (7/7)
test_write_dev_sources_missing_directories- now uses offline mode explicitlytest_write_dev_sources_missing_directories_raises_error- verifies RuntimeError in non-offline modetest_write_dev_sources_missing_directories_offline_mode- verifies offline-specific warningBenefits