Building Python nodes as part of Maven multi-module project?

I was reading my way through the Python node development documentation yesterday (Create a New Python based KNIME Extension)

Currently we build our internal (pure Java :slight_smile:) nodes as a large multi-module maven project which produces a single update site at the end, and I wondered whether there is a (ideally simple!) way to build a set of Python-based nodes into the same update site directly - i.e. to effectively have the python nodes project as one of the modules maven builds and wraps into the update site?

(I know - you can try to take the boy out of Java universe, you can’t take the Java universe out of the boy…)

Thanks

Steve

Hi Steve,

this is not possible. However, you can have dependencies in an extension A to another feature B. So when you install A, it will also install B.
From the Python side, you can see in the following link how to depend on some other feature and how it is defined in the knime.yml:
https://docs.knime.com/latest/pure_python_node_extensions_guide/index.html#extension-setup

Does this answer your question? Don’t hesitate to ask further questions!

Best regards
Steffen

2 Likes

Thanks Steffen.

I like that you now have versioning of node dialog components / settings in there - something I added to our SettingsModelRegistry API in v1.31.0 of our community contribution (Update to v1.31.0 · vernalis/vernalis-knime-nodes@a3c0036 · GitHub :slightly_smiling_face: )

Steve

Hi Steve,

I might have been wrong. I’ll let @bwilhelm shed more light on this.

Best regards
Steffen

1 Like

Hi Steve,

Adding a Python extension (or multiple) to your single build is not generally impossible. However, there is no readily available simple solution for it. During the “bundling” step of a Python extension with the script build_python_extension.py, we create a few eclipse plugins, fragments, a feature, and an update site and build them with maven. The plugins+fragments are

You can use the flag --render-folder /path/to/a/directory to see which eclipse bundles are created.

Instead of generating all eclipse plugins, etc. during the build step you could just create them once and have all plugins that you need lying next to your other plugins and include them in your usual build.

Let me know if you are interested in going this route and if you need more information.

1 Like

Hi - that definitely sounds interesting, so would definitely like to see a bit more on how you set that up. I had wondered about using the exec-maven-plugin to run that Python script.

That would also allow a *.tests plugin or fragment with testflows in which would run anyway I think as we do with our java nodes.

Thanks,

Steve

Hi @Vernalis,

You can create mixed java + python extensions, this is meant for python + java extensions, you can add java extensions to the autogenerated python one.
It is not compatible with more than one feature, but it might be worth a try. For an example see here:

best,
Gabriel

best,
Gabriel