Skip to content

Commit

Permalink
expose python version to server config
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Feb 11, 2025
1 parent 90eb255 commit f516dea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions arkouda/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Callable, Union, Optional, cast
import sys

from arkouda.client import generic_msg
from arkouda.client import generic_msg, get_config
from arkouda.pdarrayclass import pdarray, parse_single_value
from arkouda.pdarraycreation import create_pdarray
import cloudpickle
Expand Down Expand Up @@ -78,8 +78,9 @@ def apply(
setattr(apply, "is_version_supported", vers_supported)
if not vers_supported:
interp_version = f"{sys.version_info.major}.{sys.version_info.minor}"
server_version = get_config()["pythpnVersion"]
raise RuntimeError(
f"The current interpreter version ({interp_version}) is not supported by the server"
f"The current Python interpreter version ({interp_version}) does not match the server ({server_version})."
)

if not getattr(apply, "is_initialized", False):
Expand Down
4 changes: 3 additions & 1 deletion src/ServerConfig.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ module ServerConfig
class Config {
const arkoudaVersion: string;
const chplVersion: string;
const pythonVersion: string;
const ZMQVersion: string;
const HDF5Version: string;
const serverHostname: string;
Expand All @@ -211,10 +212,11 @@ module ServerConfig
var (Zmajor, Zminor, Zmicro) = ZMQ.version;
var H5major: c_uint, H5minor: c_uint, H5micro: c_uint;
H5get_libversion(H5major, H5minor, H5micro);

const cfg = new owned Config(
arkoudaVersion = (ServerConfig.arkoudaVersion:string),
chplVersion = chplVersionArkouda,
pythonVersion = (ServerConfig.pythonVersion:string),
ZMQVersion = try! "%i.%i.%i".format(Zmajor, Zminor, Zmicro),
HDF5Version = try! "%i.%i.%i".format(H5major, H5minor, H5micro),
serverHostname = serverHostname,
Expand Down

0 comments on commit f516dea

Please sign in to comment.