The utility in src/maasserver/utils/jsenums.py is used when building the package. It uses the map_enum utility that recently from moved over to src/provisioningserver/utils/__init__.py. The problem with that is that is means that all the modules imported by src/provisioningserver/utils/__init__.py must be present as "build dependencies" in the packaging.
I see three possible solutions here:
- Add all the required dependencies as build dependencies in the packaging.
- Move map_enum in a place where it can be imported in isolation without triggering a ton of imports
- Add a copy of the code of map_enum in src/maasserver/utils/jsenums.py instead of importing the shared map_enum.
The utility in src/maasserver/ utils/jsenums. py is used when building the package. It uses the map_enum utility that recently from moved over to src/provisionin gserver/ utils/_ _init__ .py. The problem with that is that is means that all the modules imported by src/provisionin gserver/ utils/_ _init__ .py must be present as "build dependencies" in the packaging.
I see three possible solutions here:
- Add all the required dependencies as build dependencies in the packaging.
- Move map_enum in a place where it can be imported in isolation without triggering a ton of imports
- Add a copy of the code of map_enum in src/maasserver/ utils/jsenums. py instead of importing the shared map_enum.