There needs to be a way to set the entry point name for a product in iotile build
- Dominant language
- Python
- Stars
- 14
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Currently, when you build a component using `iotile build`, it generates a support package and support wheel if any of the listed products in `module_settings.json` are specified as python products. Each of those products get an entry point created in the support distribution but the name of the entry point is hardcoded to always be `os.path.basename()` of the module containing the product.
For some products like `build_step`, the name of the entry point is the key that is used to invoke that product so it is useful to be able to specify it rather than have it always be the module name.
The code that does entry point assignment is:
https://github.com/iotile/coretools/blob/master/iotilebuild/iotile/build/config/site_scons/pythondist.py#L101
The place where we define what products are what is:
https://github.com/iotile/coretools/blob/master/iotilecore/iotile/core/dev/iotileobj.py#L58
We need to:
- [ ] Add a new attribute into the definition of a python product that says how its entry point should be named. Options are "module" (the default) or "class". If "class" is chosen then the product listed in `module_settings.json` must be in the form of `path/to/file.py:SomeObject` and the entry point will be `SomeObject`.
- [ ] Update `load_extensions` to pass a flag to `load_extension` based on the type of python extension loaded to know how the resulting psuedo-entrypoint should be named.
See: https://github.com/iotile/coretools/blob/master/iotilecore/iotile/core/dev/registry.py#L145
It needs to get information from the IOTile object and pass that to `load_extension` so that `load_extension` does not hardcode the name of the extension to the module name:
https://github.com/iotile/coretools/blob/master/iotilecore/iotile/core/dev/registry.py#L284
- [ ] Update the `setup.py` generation process so that we pull in the information about whether the entry point name should be module or class here:
https://github.com/iotile/coretools/blob/master/iotilebuild/iotile/build/config/site_scons/pythondist.py#L101
Contributor guide
Assessment
This issue has not been assessed yet.