Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeBuilder
: do not rely on type of input_plugin_name
The `CodeBuilder` could receive the `input_plugin_name` keyword argument as an `EntryPoint` from the `verdi code setup/duplicate` commands, so it included a switch to get the entry point name from it. Due to a bug in setuptools, the type of the `EntryPoint` can change under certain circumstances and so the `isinstance` check on the entry point does not hit. This causes the `EntryPoint` to be passed to the `Code.set_input_plugin_name` method, which does not check the type and casts the argument to `str`. However, the `__str__` of `EntryPoint` does not return just the name, but a more verbose representation. This will cause the `Code` to be unusable. The conversion of the `EntryPoint` to its name in the `CodeBuilder is removed and instead the CLI commands are responsible for passing the string entry point name. Ideally, `Code.set_input_plugin_name` is updated to only accept `str` arguments and remove the cast. But this would be a breaking change and so is not done for now.
- Loading branch information