-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
(Backport 53167) loader: support extra modules in sys.path #53440
Conversation
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.
Pretty sure the code is fine, and the test failure is due to a dependency failing to get installed.
We need to get that sorted out so the tests all pass.
re-run all |
@aplanas is there any way that these git test failures
are related to this change? It seems unlikely to me without further digging, and weird that it's just these couple of platforms on which it's failing... 🤷♂ |
@waynew I rebased the code, to relaunch the CI |
(cherry picked from commit bb798685d29261f5dc290ba08694214be2204a7a)
(cherry picked from commit f7b0c8b68470256de225bee7343ff21c9af8cc60)
(cherry picked from commit 5a8a0ce3c3f1d27f7ae55167df8c98d021873f9e)
The LazyLoader class populate the sys.path array to add the path that contains the Python module that will be executed. If before this point sys.path gets extended (like when globally the extmods utils directory in added in some places, like after a sync) the code can find all the dependencies. This patch adds a new parameter to the LazyLoader class, extra_module_dirs, that will populate locally the sys.path before executing the the module. This can be used to guarantee that in utils (and other modules) will be available to the modules and states in any circumstances and Python process. (cherry picked from commit 670974f9d7e95a030a1429b3abe2e75873ebb3b6)
This reverts commit 7e82f3e. (cherry picked from commit e0e5c282583db7fd3ba4d21bcfadf30943f04ab7)
b30a1c9
to
b23f6b4
Compare
Rebased on master as part of #53167 |
What does this PR do?
The LazyLoader class populate the sys.path array to add the path
that contains the Python module that will be executed. If before
this point sys.path gets extended (like when globally the extmods
utils directory in added in some places, like after a sync) the
code can find all the dependencies.
This patch adds a new parameter to the LazyLoader class,
extra_module_dirs, that will populate locally the sys.path before
executing the the module.
This can be used to guarantee that in utils (and other modules) will be
available to the modules and states in any circumstances and Python
process.
Tests written?
Yes
(backport #53167)