File2 is not a valid CodeChannel
-
Ahaaa, I managed to see wher the issue comes from !
It seems like File2 was added in DSF 3.5, and I have a mismatch between the DSF version and the python bindings.
To try and fix that, I added the following requirement in the
plugin.json
file:"sbcPythonDependencies": [..., "dsf-python>=3.5.0.2rc2"],
But the plugin still fails, so I have the impression that the
dsf-python
package is not installed with the correct version. -
Looking at the installation code from the Duet Software Framework repository, I feel like that this line might be wrong, with the comparison inverted:
comparison = 'version("' + installedVersion + '")' + mCompare + 'version("' + mVersion + '")' # version numbers are strings
Could this come from here ?
-
@Ant1 one for @chrishamm
-
@stuartofmt any idea?
-
@chrishamm @stuartofmt I also find a bit dangerous / weird to use
exec(...)
to compare the versions, as it can very easily lead to code injection, even though it is probably not the intent of people writing plugins.
Edit: the allowed characters are limited (for example, no parentheses), so this is probably not possible. -
@Ant1 @chrishamm @stuartofmt I think the issue here is that the version of dsf-python is flagged as beta (rc) and
pip3 install dsf-python>=version
installs the last stable version.
To make it to work, you either need to use equal :pip3 install dsf-python==version
or to add the--pre
argument :pip3 install --pre dsf-python>=version
although, I'm not sure this is recommended as it may install unwanted beta versions. -
Sorry - for some reason I have not been getting notifications about this thread until today.
I will take a look at the installation script to see if it can be improved but ...
Please note that it's all a bit "vague". By that I mean there is no sure-fire way to check versions across all libraries. It depends too much on how the author chose to identify (or not) versions.
Regarding the use of exec. I was being a bit lazy but at the same time its limited to calling version. I'll take a closer look.
-
It looks like I have some work to do. I've not dug deeply into it yet but it seems Bookworm does not like pip3 and would prefer / needs to use pipx.
I can check versions of Debian and make the appropriate differences transparent to the install program. I just need a few days to carve out some spare time and then it will mostly be testing.EDIT: Looks like using apt is the prefered way ...
If I'm missing something obvious here, that you have already encountered / resolved, please let me know.
-
It looks like I have some work to do. I've not dug deeply into it yet but it seems Bookworm does not like pip3 and would prefer / needs to use pipx.
I can check versions of Debian and make the appropriate differences transparent to the install program. I just need a few days to carve out some spare time and then it will mostly be testing.EDIT: Looks like using apt is the prefered way ...
If I'm missing something obvious here, that you have already encountered / resolved, please let me know.
I've created a chatroom to take any implementation discussion off-line. I'm progressing on the basis of providing each python plugin with its own virtual environment.
-
@Ant1 You can now install the
python3-dsf-python
Debian package or reference it in your plugin provided you're on v3.5 or newer. This package was gratefully provided by @Falcounet.