-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre-requisite checker #29
Comments
Another example when installing the Geodata WB there is a dependency on the animation WB: |
Another example with installing Assembly2 |
@yorikvanhavre any feedback? |
Yes, we could think about something like that... It could be something simple, such as adding some "PREREQUISITE.md" file to the repo, that would contain a list of other workbenches this one depends on, that the addons manager could read, and install the needed ones if needed... |
@yorikvanhavre good idea. Sound simple and direct. |
@yorikvanhavre just to get the ball rolling: Edit: using QGIS metadata.txt format: |
A simple text file describing dependencies between FreeCAD workbenches sounds fine to me. When it comes to checking for external software installed on the system, like OpenFOAM, calculix, gmsh, etc, perhaps a function could be mandated in the addons which the manager would call to ask it to check its external dependencies. Or maybe safter just to make this the module's responsibility to do every time it is loaded. I'm not sure how easily it could be automated, especially checking version numbers, etc? |
Pivy usecase: https://forum.freecadweb.org/viewtopic.php?f=3&t=22453 |
good idea! |
Examples of QGIS's metadata.txt file within each QGIS plugin: Here is a plugin builder script that is a UI that simplifies the plugin creation process: |
For the scipy test I wrote something simple in within the pyrate workbench. There is a paths.txt file where to check and it trys to import scipy afterwards throwing an exception if import fails. Is this the intended meaning of a pre requisite check? https://github.com/joha2/pyrate/blob/master/InitGui.py#L35 Unfortunately I had no better idea at the time being and it would be nice to have such a pre requisite checker. :-) For the Fenics import/export I use the FEM WB mesh helper functions excessively, so these functions must be available. Up to now there is no Fenics needed, but maybe this will be necessary in the future. Best wishes |
CFDFoam guys are making some headway: jaheyns/CfdOF@d2f9a1f |
We could also think about using a metadata.yml format for the file...? |
Linking an older thread from the forums: The FreeCAD plugin installer |
Played around with adapting the QGIS metadata approach:
Perhaps there should be a section appended at the bottom for dependencies like:
|
I would rather go by parts, because python modules will be a tricky thing to do (different installation methods on different platforms, possible permissions problems, etc). But having one WB depend on another is already something we can work on. Or, we could start simple, and simply pop up a dialog if some dependencies are unmet (both workbenches and python modules), and let the user sort things by him/herself. Then in a later step we see if some of those can be automated. Your metadata.txt seems a good solution, is there an existing python parser for it? |
https://github.com/qgis/QGIS-Django/blob/master/qgis-app/plugins/validator.py FYI a python implementation in the QGIS Official Python Plugin Repository code. BTW, the format is ini file so it's supported by standard libraries. |
Ok thanks, in any case we can just start simple, with getting the lines that begin with workbenches= and pylibs= |
@yorikvanhavre FYI QGIS does not have dependency management yet. |
@yorikvanhavre
checkout Paver https://pythonhosted.org/Paver/ Edit: posted to the FC forum |
The DesignSPHysics folks are taking an interesting approach to installation. Checkout: |
Started a boilerplate metadata.txt file at: https://gist.github.com/luzpaz/5e12362f0771eec9e6e82ef0e4d1ba56
|
Is there already code implemented which can read this metadata.txt file? What is the |
@joha2 see #29 (comment)
We have yet to designate that. Most likely serves as an organization/search function to differentiate plugins/addons from each other. |
There is now a basic dependency checker implemented in FreeCAD/FreeCAD@456d3b80f
|
Sweet! |
Right you are. Fixed in FreeCAD/FreeCAD@58909797a |
Nice one! Is there also the possibility to divide pylibs and workbenches in mandatory and optional ones, such that the workbench or the macro could check, whether the optional ones are found and perhaps offer a failsafe solution? E.g. if you need scipy (which is problematic for win64 together with FreeCAD) and you wrote some functionality as failsafe solution for a missing scipy library then it would be nice to have a check whether these optional requirements are met. |
good idea. Done in FreeCAD/FreeCAD@99e400e87 |
Looks like we have a new ini variables Edit: updated the metadata.txt boilerplate |
To make it a little bit more complicated... does 'optional' also cover the case that at least one of the options has to be available? |
BTW: CFDFoam needs gmsh>2.13, gnuplot+python-gnuplot and optional cfMesh. |
Another reference to addon-manager/pre-requisite checker: https://forum.freecadweb.org/viewtopic.php?f=10&t=23704&p=185205#p185031 |
See starting Here: https://forum.freecadweb.org/viewtopic.php?f=18&t=23548&start=10#p183879 |
Created the beginnings of a metadata.txt generator: |
Please have a look into #71 |
@yorikvanhavre where is the documentation for |
I've added more complete dependency resolution in FreeCAD/FreeCAD#5339 -- this reads both package.xml and metadata.txt information and consolidates them, and then walks the dependency tree when an Addon is installed and presents the user with a complete list of the package's requirements. At present it does not offer to automatically install them, this is under discussion in the forums. https://forum.freecadweb.org/viewtopic.php?f=22&t=65044 You can now find rudimentary documentation of the metadata.txt file in https://wiki.freecadweb.org/Workbench_creation, and more complete documentation of package.xml in https://wiki.freecadweb.org/Package_Metadata |
That PR is now merged, I'm closing this as basically implemented (of course there's always more to do, but the basic feature is there). |
@chennes Thanks for merging! |
A pre-requisite checker would be a helpful tool for FreeCAD in general, I believe. Maybe it's worth making a FC wide function that can do this for addons in general?
It would help working towards realizing issue 857
References:
Mentioned in CFDFoam thread
Discussion going on in Splitting FreeCAD up in to smaller packages thread.
Mantis: Ticket 3032 and 857
What it could check for:
The text was updated successfully, but these errors were encountered: