-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add a mechanism to swap nailgun versions on demand #12840
Conversation
Satellite._swap_nailgun("x.y.z") can be used to change out the operating version of nailgun.
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.
Some comments and Questions !
to_clear = [k for k in sys.modules.keys() if 'nailgun' in k] | ||
[sys.modules.pop(k) for k in to_clear] |
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.
Does this clearance should be done after uninstalling the previous Nailgun version and before installing new nailgun version ?
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.
This implementation would likely cleanup the bits of newly installed nailgun as well hence above comment, correct me if I am wrong .
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.
the order here is less important than you might think. the current modules are live in memory, so this only really helps for new imports (like what we do when recreating the Satellite.api
attributes.
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.
Interesting how popping out the nailgun specific modules from sys.modules would still make nailgun module available.
Do you mean the newly installed nailgun isnt the part of sys.modules
and only unistalled is ?
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.
ACK pending questions/doubts!
to_clear = [k for k in sys.modules.keys() if 'nailgun' in k] | ||
[sys.modules.pop(k) for k in to_clear] |
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.
Interesting how popping out the nailgun specific modules from sys.modules would still make nailgun module available.
Do you mean the newly installed nailgun isnt the part of sys.modules
and only unistalled is ?
@jyejare re:
Until a module is loaded via an import statement, it won't be added to |
Satellite._swap_nailgun("x.y.z") can be used to change out the operating version of nailgun.
This actually changes out the installed version of nailgun on the fly, so this should only be used in upgrades.