This PR implements FreeCAD and Python dependency installation when using the Addon Manager to install an Addon.
For historical and compatibility reasons, three different metadata files are examined for dependency information:
- package.xml -- Preferred, specify all types of dependencies in this file
- metadata.txt -- Optional, deprecated: for FreeCAD workbench and Python required and optional dependencies
- requirements.txt -- Optional: for Python required dependencies, might be useful for some packagers
When a user requests installation of a package with dependencies, the Addon Manager resolves them as follows:
- Dependencies on FreeCAD Workbenches are checked against the installed WB list, and if not satisfied the installation is terminated: this is an unrecoverable condition, a new copy of FreeCAD with the appropriate Workbenches is required.
- Dependencies on other FreeCAD Addons are checked, and if found are added to a list of required dependencies.
- Dependencies on Python packages are checked by attempting to import the required package, and catching the import error on failure and adding the failure to the list of required dependencies.
- Optional Python dependencies are checked the same way as required, but added to a separate list.
- If there are unmet dependencies they are presented to the user in three columns: one for FreeCAD addon dependencies (installed with the Addon Manager as a normal FreeCAD Addon), another for Python requirements (installed with pip into a FreeCAD-specific USER_APP_DATA_DIR/AdditionalPythonPackages directory), and finally a third column of optional Python packages, presented as a checkable list for the user to select from for installation.
NOTE: Updated 2/25/2023 to clarify that package.xml is now the Addon Manager's preferred source for ALL dependency information. The other two are included for historical reasons, but are no longer needed for any type of dependency. Note also that Python dependency version information is NEVER respected, regardless of which file is used (including requirements.txt).