HappenLee commented on code in PR #60751:
URL: https://github.com/apache/doris/pull/60751#discussion_r2825839215
##########
be/src/service/backend_service.cpp:
##########
@@ -1311,5 +1312,46 @@ void
BaseBackendService::test_storage_connectivity(TTestStorageConnectivityRespo
response.__set_status(status.to_thrift());
}
+void BaseBackendService::get_python_envs(std::vector<TPythonEnvInfo>& result) {
+ auto& manager = PythonVersionManager::instance();
+ const auto& envs = manager.get_envs();
+
+ std::string env_type_str;
+ switch (manager.env_type()) {
+ case PythonEnvType::CONDA:
+ env_type_str = "conda";
+ break;
+ case PythonEnvType::VENV:
+ env_type_str = "venv";
+ break;
+ }
+
+ for (const auto& env : envs) {
+ TPythonEnvInfo info;
+ info.__set_env_name(env.env_name);
+ info.__set_full_version(env.python_version.full_version);
+ info.__set_env_type(env_type_str);
+ info.__set_base_path(env.python_version.base_path);
+ info.__set_executable_path(env.python_version.executable_path);
+ result.push_back(std::move(info));
+ }
+}
+
+void BaseBackendService::get_python_packages(std::vector<TPythonPackageInfo>&
result,
+ const std::string&
python_version) {
+ PythonVersion version;
+
THROW_IF_ERROR(PythonVersionManager::instance().get_version(python_version,
&version));
+
+ std::vector<std::pair<std::string, std::string>> packages;
+ THROW_IF_ERROR(list_installed_packages(version, &packages));
+
+ for (const auto& [name, ver] : packages) {
+ TPythonPackageInfo info;
Review Comment:
implement the method in py env
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]