How to add Gnuplot to org.spyder_ide.spyder as addon?

So I want to add Gnuplot in addition to Matplotlib for Spyder (Python IDE).
If I understand correctly, it would be better if I create gnuplot as another Flatpak rather than include Gnuplot into the Spyder manifest?

Here is the manifest so far. How do I make it a plugin or addon for Spyder or other Flatpak Python IDE?

app-id: info.gnuplot.Gnuplot
runtime: org.kde.Sdk
runtime-version: 5.15-23.08
sdk: org.kde.Sdk
command: gnuplot
finish-args:
  - --share=ipc
  - --device=dri
modules:
  - name: gnuplot
    sources:
      - type: archive
        url: https://sourceforge.net/projects/gnuplot/files/gnuplot/6.0.0/gnuplot-6.0.0.tar.gz
        sha256: 635a28f0993f6ab0d1179e072ad39b8139d07f51237f841d93c6c2ff4b1758ec
        x-checker-data:
          type: anitya
          project-id: 1216
          url-template: https://sourceforge.net/projects/gnuplot/files/gnuplot/$version/gnuplot-$version.tar.gz

You would have to look at Extensions - Flatpak documentation and see if it fits what you want to do.

Hi,
I think this is the one I am looking for.
But I am not certain about the directory thing.
I want the gnuplot file to go to the /bin directory and be discover by any app, not just Spyder. This is my attempt so far. But I could not make gnuplot discovered by any app in /bin.

app-id: info.gnuplot.Gnuplot
runtime: org.kde.Platform
runtime-version: 5.15-23.08
sdk: org.kde.Sdk
command: gnuplot
add-extensions:
  org.kde.Platform:
    directory: /bin
    version: '23.08'
modules:
  - name: gnuplot
    sources:
      - type: archive
        url: https://sourceforge.net/projects/gnuplot/files/gnuplot/6.0.0/gnuplot-6.0.0.tar.gz
        sha256: 635a28f0993f6ab0d1179e072ad39b8139d07f51237f841d93c6c2ff4b1758ec
        x-checker-data:
          type: anitya
          project-id: 1216
          url-template: https://sourceforge.net/projects/gnuplot/files/gnuplot/$version/gnuplot-$version.tar.gz

add-extensions defines the extension point from the runtime or application side, not the extension. It has to be defined in all applications or runtimes in order to make your extension available everywhere.

You want to write an extension for such an extension point (either one you define in Spyder or just org.freedesktop.Sdk.Extension, to make it available for all applications based on org.freedesktop.Sdk or its derived Sdks).

Take a look at Extension Manifest. You’ll have to adhere to the spec (e.g. id uses the prefix of the extension point). But this allows you to search for org.freedesktop.Sdk.Extension examples in the GitHub repositories.