Addon manager: install dependencies (#5376)
Addon Manager: Dependency Installation The Addon Manager can now attempt to use pip directly to install required packages as specified in either metadata.txt or requirements.txt files provided by AddOns. The packages are installed into FreeCAD.getUserAppDataDir()/AdditionalPythonPackages directory. Only simplified requirements.txt data is supported: any version information is stripped out, and only packages are supported (that is, no pip arguments, included files, etc.). Further, packages are checked against a list of allowed packages prior to being suggested for installation. Addon authors should submit a PR to the FreeCAD repo adding their requirements to the allowed list, for packages that are not already on the list (this is a malware-prevention mechanism).
This commit is contained in:
@@ -98,9 +98,10 @@ class AddonManagerRepo:
|
||||
self.description = None
|
||||
from addonmanager_utilities import construct_git_url
|
||||
|
||||
self.metadata_url = (
|
||||
"" if not self.url else construct_git_url(self, "package.xml")
|
||||
)
|
||||
if "github" in self.url or "gitlab" in self.url or "salsa" in self.url:
|
||||
self.metadata_url = construct_git_url(self, "package.xml")
|
||||
else:
|
||||
self.metadata_url = None
|
||||
self.metadata = None
|
||||
self.icon = None
|
||||
self.cached_icon_filename = ""
|
||||
@@ -113,7 +114,7 @@ class AddonManagerRepo:
|
||||
self.requires: Set[str] = set()
|
||||
self.blocks: Set[str] = set()
|
||||
|
||||
# And maintains a list of required and optional Python dependencies
|
||||
# And maintains a list of required and optional Python dependencies from metadata.txt
|
||||
self.python_requires: Set[str] = set()
|
||||
self.python_optional: Set[str] = set()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user