Hack to fix ad_rss's import namespaces #8152
Open
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.
Description
Fixes #8093
This is a hack that fixes the messy import namespacing of the
ad_rss
library. Importingcarla
which in turns importsad_rss as ad
puts provides all its subpackages as top-level pckages/modules.For example this is currently valid:
This raises an ImportError
Also it creates ambigious import behavior where the order of imports matter, e.g. if I had a subpackage/module names like any of ad_rss subpackages the following code will also fail as it imports the wrong module
This is non-standard and confusing behavior.
See also: intel/ad-rss-lib#258
Note: This issue should actually be addressed by ad_rss lib or somewhere in the packaging process before creating the
.so
fileThis PR manually adjust
sys.modules["ad..."]
tosys.modules["carla.ad..."]
so that correct and normal import behavior is possible.Where has this been tested?
Possible Drawbacks
This change is