Skip to content

Commit c6081e5

Browse files
5775 Fix _get_latest_bundle_version issue on Windows (#5787)
Signed-off-by: Yiheng Wang <vennw@nvidia.com> Fixes #5775 . ### Description This PR fixes the issue of `_get_latest_bundle_version` on Windows (`os.path.join` will produce backslash which will create a wrong url) Thanks @SachidanandAlle for finding this issue. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Yiheng Wang <vennw@nvidia.com>
1 parent 4381e4b commit c6081e5

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

monai/bundle/scripts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _get_latest_bundle_version(source: str, name: str, repo: str):
182182
return None
183183
elif source == "github":
184184
repo_owner, repo_name, tag_name = repo.split("/")
185-
return get_bundle_versions(name, repo=os.path.join(repo_owner, repo_name), tag=tag_name)["latest_version"]
185+
return get_bundle_versions(name, repo=f"{repo_owner}/{repo_name}", tag=tag_name)["latest_version"]
186186
else:
187187
raise ValueError(f"To get the latest bundle version, source should be 'github' or 'ngc', got {source}.")
188188

tests/test_bundle_download.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
command_line_tests,
2727
skip_if_downloading_fails,
2828
skip_if_quick,
29-
skip_if_windows,
3029
)
3130

3231
TEST_CASE_1 = ["test_bundle", None]
@@ -58,7 +57,6 @@
5857
]
5958

6059

61-
@skip_if_windows
6260
class TestDownload(unittest.TestCase):
6361
@parameterized.expand([TEST_CASE_1, TEST_CASE_2])
6462
@skip_if_quick

0 commit comments

Comments
 (0)