Skip to content

Commit

Permalink
Winfix2 (#264)
Browse files Browse the repository at this point in the history
* search for executable with exe suffix

* commet out reduce shape test for now

* fix lint error

* bump version
  • Loading branch information
jreadey authored Oct 3, 2023
1 parent da76616 commit ca958f5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hsds/basenode.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from .util.k8sClient import getDnLabelSelector, getPodIps
from . import hsds_logger as log

HSDS_VERSION = "0.8.3"
HSDS_VERSION = "0.8.4"


def getVersion():
Expand Down
18 changes: 11 additions & 7 deletions hsds/hsds_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ def get_cmd_dir():
sys_bin_dir = os.path.join(sys.exec_prefix, bin_dir)
if os.path.isdir(sys_bin_dir):
logging.debug(f"sys bin_dir: {sys_bin_dir}")
if os.path.isfile(os.path.join(sys_bin_dir, hsds_shortcut)):
logging.info(f"using cmd_dir: {sys_bin_dir}")
return sys_bin_dir
hsds_executable = os.path.join(sys_bin_dir, hsds_shortcut)
# window builds add on a .exe suffix,
# so check with and without the suffix
for suffix in ("", ".exe"):
if os.path.isfile(hsds_executable + suffix):
logging.info(f"using cmd_dir: {sys_bin_dir}")
return sys_bin_dir

# fall back to just use __file__.parent
bin_dir = Path(__file__).parent
Expand Down Expand Up @@ -260,11 +264,11 @@ def run(self):

py_exe = sys.executable
cmd_path = os.path.join(self._cmd_dir, "hsds-node")

if not os.path.isfile(cmd_path):
# search corresponding location for windows installs
cmd_path = os.path.join(sys.exec_prefix, "Scripts")
cmd_path = os.path.join(cmd_path, "hsds-node-script.py")
if not os.path.isfile(cmd_path):
if os.path.isfile(cmd_path + ".exe"):
cmd_path += ".exe"
else:
raise FileNotFoundError("can't find hsds-node executable")

for i in range(count):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.8"
version = "0.8.3"
version = "0.8.4"

dependencies = [
"aiohttp == 3.8.5",
Expand Down
6 changes: 6 additions & 0 deletions tests/integ/dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,12 @@ def testResizableDataset(self):
self.assertEqual(rsp.status_code, 201)
rspJson = json.loads(rsp.text)

# reduce the size to 5 elements
# payload = {"shape": 5}
# rsp = self.session.put(req, data=json.dumps(payload), headers=headers)
# self.assertEqual(rsp.status_code, 201)
# rspJson = json.loads(rsp.text)

# verify updated-shape using the GET shape request
rsp = self.session.get(req, headers=headers)
self.assertEqual(rsp.status_code, 200)
Expand Down

0 comments on commit ca958f5

Please sign in to comment.