MCPcopy Index your code
hub / github.com/RustPython/RustPython / install_pip

Function install_pip

src/lib.rs:145–157  ·  view source on GitHub ↗
(installer: InstallPipMode, scope: Scope, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

143}
144
145fn install_pip(installer: InstallPipMode, scope: Scope, vm: &VirtualMachine) -> PyResult<()> {
146 if !cfg!(feature = "ssl") {
147 return Err(vm.new_exception_msg(
148 vm.ctx.exceptions.system_error.to_owned(),
149 "install-pip requires rustpython be build with '--features=ssl'".into(),
150 ));
151 }
152
153 match installer {
154 InstallPipMode::Ensurepip => vm.run_module("ensurepip"),
155 InstallPipMode::GetPip => get_pip(scope, vm),
156 }
157}
158
159// pymain_run_file_obj in Modules/main.c
160fn run_file(vm: &VirtualMachine, scope: Scope, path: &str) -> PyResult<()> {

Callers 1

run_rustpythonFunction · 0.85

Calls 5

get_pipFunction · 0.85
new_exception_msgMethod · 0.80
run_moduleMethod · 0.80
ErrClass · 0.50
to_ownedMethod · 0.45

Tested by

no test coverage detected