Throughout the PyB internal plugins use project.build_depends_on:
Firstly, PyB build does not really depend on those. It's the runtime use of the plugin that requires these external tools.
Therefore, I propose the following:
- Create another method
project.plugin_depends_on(package_name, version_spec=None, external_tool=None)
project.plugin_depends_on will:
- via
pip show <package_name> check the version of the package installed
- if nothing is installed,
pip install <package_name>[version_spec] will be executed
- if package is installed but
version_spec is specified and version is not contained in SpecifierSet pip install --upgrade <package_name>[version_spec] will be run
- once package versions are settled, if
external_tool is specified the assert_can_execute will be performed.
@mriehl @esc review please
Throughout the PyB internal plugins use
project.build_depends_on:Firstly, PyB build does not really depend on those. It's the runtime use of the plugin that requires these external tools.
Therefore, I propose the following:
project.plugin_depends_on(package_name, version_spec=None, external_tool=None)package_nameis package name 😄version_spec, if specified is a required PEP0440 SpecifierSet (see Plugin-specified PyB API version constraints #271)external_toolif specified is then name of the executable to check withassert_can_executeproject.plugin_depends_onwill:pip show <package_name>check the version of the package installedpip install <package_name>[version_spec]will be executedversion_specis specified and version is not contained in SpecifierSetpip install --upgrade <package_name>[version_spec]will be runexternal_toolis specified theassert_can_executewill be performed.@mriehl @esc review please