Add support for iotile-support packages specifying dependencies
- Dominant language
- Python
- Stars
- 14
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
## Overview
Right now, `iotile-build` can produce python packages as part of the build process of building a component (if python packages are specified in the component's `module_settings.json` file. However, there is no place for specifying addition `install_requires` packages in the autogenerated `setup.py` file that is created as part of the build process. This means that any `iotile-support` package generated via this mechanism will fail if:
- it requires a package that is not installed by `iotile-core`
- the user didn't happen to magically have that package installed.
## Fix
The fix is in 3 places:
- [x] We need to add an addition member in `IOTile`, which is the class that actually parses the `module_settings.json` file:
https://github.com/iotile/coretools/blob/master/iotilecore/iotile/core/dev/iotileobj.py#L179
There should be a `support_wheel_depends` variable that looks for a `python_depends` key in the module that is a list of strings and if it is found it should set `support_wheel_depends` to that list of strings. These should be strings like "pyparsing >= 2.2.0", i.e. things that could be copy-pasted into a setup.py file.
- [x] We need to modify `iotile-build` to look at `support_wheel_depends` when generating a `setup.py` during a component build.
The setup.py file is generated from a `jinja2` template stored here:
https://github.com/iotile/coretools/blob/master/iotilebuild/iotile/build/config/templates/setup.py.tpl
The actual function that populates the template is here:
https://github.com/iotile/coretools/blob/master/iotilebuild/iotile/build/config/site_scons/pythondist.py#L76
You'll need to modify `deps` to include any additional dependencies explicitly specified in `support_wheel_depends`.
- [ ] We'll need to modify and rerelease any components that have this issue (currently `iotile-support-lib-controller-3` is the only known case). This can be done in a separate step after fixing this coretools issue and merging.
@haroal Can you take a look at fixing this? It'll be a good introduction to some of the internals of Coretools. Take a look at the files linked above and we can meet tomorrow and talk about any questions you have about this.
This will resolve #386.
Contributor guide
Assessment
This issue has not been assessed yet.