[FEA]: Add check to CI to detect incorrect imports of morpheus._lib
modules
#727
Closed
2 tasks done
Labels
feature request
New feature or request
Is this a new feature, an improvement, or a change to existing functionality?
New Feature
How would you describe the priority of this feature request
High
Please provide a clear description of problem this feature solves
Imports of
morpheus._lib
should be used very rarely and will follow a specific format when used correctly. Sometimes tools like VS Code can auto add imports to themorpheus._lib
module when a similar name is used inmorpheus
. For example,from morpheus._lib.messages import MessageMeta
should really befrom morpheus.messages import MessageMeta
which will auto select the correct class depending on whether C++ is enabled or not.Describe your ideal solution
Since we should never be using
from morpheus._lib.XXX import YYY
it should be easy to detect in CI any incorrect uses. The following is a list of the rules:from morpheus._lib.XXX import YYY
from morpheus.XXX import YYY
to pick the correct C++/Python version__init__.py
import morpheus._lib.XXX
import morpheus.XXX
import morpheus._lib.XXX as YYY
import morpheus.XXX as YYY
import morpheus._lib.XXX as _XXX
Describe any alternatives you have considered
Looked for ways to prevent the auto importer in VSCode from using
morpheus._lib
, but it doesnt seem possible.Additional context
This recently broke the SID Visualization example in 23.01.00
Code of Conduct
The text was updated successfully, but these errors were encountered: