MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / executePipListCommand

Function executePipListCommand

src/cli/UpdateCommand.cpp:300–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298 }
299
300 void executePipListCommand(ScriptEngineInstance& pythonEngine) {
301 // TODO: seems like the CLI is picking up your virtualenvironment, so we manipulate sys.path to keep only the E+ folder for now
302 const std::string cmd = R"python(
303import sys
304sys.path = [x for x in sys.path if "EnergyPlus" in x]
305import importlib.metadata
306mods = sorted([f"{x.name}=={x.version}" for x in importlib.metadata.distributions()])
307[print(x) for x in mods]
308 )python";
309 pythonEngine->exec(cmd);
310 }
311
312} // namespace cli
313} // namespace openstudio

Callers 1

mainFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected