-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Production bundles: new options for MC and target machine path #1598
Production bundles: new options for MC and target machine path #1598
Conversation
|
||
# If the production arg was pulled here, re-insert it to the remaining args | ||
# so that the game parser also knows to run in production mode. | ||
if args.production: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quirk of the parse_known_args()
method is that it consumes the known args and only passes unknown args to the next consumer. In this case I need both init.py and game.py to consume the -P
arg.
I looked through the parser documentation and didn't see any way to keep an arg in both places, so here I re-add it so that game.py can consume it. Totally open to a better approach!
Yeah. I will have a look. I catch some cases in tests where we do not cancel futures properly. |
Kudos, SonarCloud Quality Gate passed!
|
I need to look further into this. Feel free to merge this anyway. Something looks slightly different in Python 3.8 on Windows. The warning is harmless on its own. |
This PR makes three additions to the fabulous production bundle behavior.
Production bundle building without MC
This PR adds support for the argument
-b
when runningmpf build production_bundle
, which builds an MPF bundle only. The-b
arg was chosen because that's the argument used to run MPF without connecting to a BCP host—effectively, how you run MPF without an MC.Explicit machine paths for production bundles
A side-effect of how the production bundles are built—loading all the config files and pickling them—is that the bundle is saved with the
machine_path
of the machine that generated the bundle. This causes trouble when trying to distribute a bundle to other machines with different file structures. This PR adds a new command argument--dest-path=<machine_path>
which will generate the config data and then overwrite themachine_path
with the explicitly-provided path.The machine path is a private variable, so this PR also adds a method
set_machine_path(pathname)
to the config loader.Running production bundles without /config
This PR adds support for running an MPF machine from a production bundle without any other file structure requirements. Currently, MPF will always check for a machine folder by looking for the /config folder. When running production bundles this folder is not used, so this PR makes it not required.