Repository navigation
Conversation
When the service module was not in the MLproject's folder, the header recorded its absolute path, so a committed MLproject carried a machine-specific path and --check failed on every other machine. A src-layout service had to keep a root main.py only to get a portable header. The header now names the module relative to the MLproject's folder (the absolute path stays only where no relative one exists, such as another drive on Windows), and its regenerate command adds -o when the MLproject is not next to the module.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
chapkit mlproject exportwrites the module path into the MLproject header. When the module was not in the MLproject's folder, that was the absolute path, for example/Users/<name>/.../src/my_model/service.py. A committed MLproject then carried a machine-specific path, andexport --checkfailed on every other machine, CI included, because it compares the whole file. Asrc/-layout service had to keep a rootmain.pyonly to get a portable header.src/my_model/service.py. The absolute path remains only where no relative path exists, such as a module on another drive on Windows.-o <name>, becauseexportotherwise writes next to the module.main.pycase, is unchanged: the header still readsmain.py.The MLproject guide describes exporting a
src/-layout service to the project root.Test plan
src/pkg/exported to the project root gets a relative header with no temporary path in it, and the header's command run from the project folder passes--check.-ointo another folder and into the module's folder.make lint; full test suite: 1095 passed, 12 skipped.chapkit_deep_auto_regressive_modelfromsrc/chapkit_deep_auto_regressive/service.py: the header is relative and the MLproject body is unchanged.