Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hidden windows failures #359

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
# coverage report
#----------------------------------------------
- name: Generate coverage results
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
shell: bash
run: |
poetry run coverage run -m pytest
poetry run coverage xml
Expand Down
6 changes: 3 additions & 3 deletions linkml_runtime/linkml_model/linkml_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pathlib import Path
from pathlib import Path, PurePath
from enum import Enum, auto
from typing import Dict, Optional, Union, Tuple, NamedTuple
from urllib.parse import urljoin
Expand Down Expand Up @@ -152,7 +152,7 @@ def LOCAL_PATH_FOR(source: Source, fmt: Format) -> str:


def GITHUB_IO_PATH_FOR(source: Source, fmt: Format, version="latest") -> str:
path = '/'.join([version, 'linkml_model', *_build_path(source, fmt)])
path = PurePath(version, 'linkml_model', *_build_path(source, fmt)).as_posix()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for a URL, not an OS path, which is why it joins on / rather than using pathlib. Looks like the pathlib impl should be equivalent but just explaining the manual string munging

return urljoin(GITHUB_IO_BASE, path)


Expand All @@ -178,7 +178,7 @@ def tag_to_commit(tag: str) -> str:

# Return the absolute latest entry for branch
if release is ReleaseTag.LATEST or (release is ReleaseTag.CURRENT and branch != "main"):
path = '/'.join([branch, 'linkml_model', *_build_path(source, fmt)])
path = PurePath(branch, 'linkml_model', *_build_path(source, fmt)).as_posix()
return urljoin(GITHUB_BASE, path)

# Return the latest published version
Expand Down
5 changes: 3 additions & 2 deletions linkml_runtime/utils/schemaview.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from functools import lru_cache
from copy import copy, deepcopy
from collections import defaultdict, deque
from pathlib import Path
from pathlib import Path, PurePath
from typing import Mapping, Optional, Tuple, TypeVar
import warnings

Expand Down Expand Up @@ -304,7 +304,8 @@ def imports_closure(self, imports: bool = True, traverse: Optional[bool] = None,
# we should treat the two `types.yaml` as separate schemas from the POV of the
# origin schema.
if sn.startswith('.') and ':' not in i:
i = os.path.normpath(str(Path(sn).parent / i))
# This cannot be simplified. os.path.normpath() must be called before .as_posix()
i = PurePath(os.path.normpath(PurePath(sn).parent / i)).as_posix()
todo.append(i)

# add item to closure
Expand Down
Loading