MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / mp_install_requirement

Function mp_install_requirement

aura/apip.py:91–116  ·  view source on GitHub ↗

Monkey patch for the InstallRequirement.install method It collects the package information and sends it to aura for security audit User then has a choice to proceed or abort the installation process based on audit results

(
    self,  # type: InstallRequirement
    *args,
    **kwargs
)

Source from the content-addressed store, hash-verified

89
90
91def mp_install_requirement(
92 self, # type: InstallRequirement
93 *args,
94 **kwargs
95):
96 """
97 Monkey patch for the InstallRequirement.install method
98 It collects the package information and sends it to aura for security audit
99 User then has a choice to proceed or abort the installation process based on audit results
100 """
101 data = {
102 "format": "0.1",
103 "cmd": sys.argv,
104 "name": self.name,
105 "path": self.source_dir or self.local_file_path,
106 "wheel": self.is_wheel,
107 "is_pinned": self.is_pinned,
108 "editable": self.editable,
109 "update": getattr(self, "update", False),
110 "hash": self.link.hash,
111 "filename": self.link.filename,
112 "url": self.link.url,
113 "dependency_chain": get_dependency_chain(self),
114 }
115 check_package(data)
116 InstallRequirement._orig_install(self, *args, **kwargs)
117
118
119def monkey_patch():

Callers

nothing calls this directly

Calls 2

get_dependency_chainFunction · 0.85
check_packageFunction · 0.85

Tested by

no test coverage detected