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 #360

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions linkml_runtime/linkml_model/linkml_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path
from enum import Enum, auto
from typing import Dict, Optional, Union, Tuple, NamedTuple
from typing import Dict, Optional, Union, NamedTuple
from urllib.parse import urljoin
from dataclasses import dataclass

Expand Down Expand Up @@ -84,7 +84,7 @@ class _Path:
SHEXJ = FormatPath("shex","shexj" )
SQLDDL = FormatPath("sqlddl","sql" )
SQLSCHEMA = FormatPath("sqlschema","sql" )
YAML = FormatPath(str(Path("model") / "schema"),"yaml" )
YAML = FormatPath((Path("model") / "schema").as_posix(),"yaml" )

@classmethod
def items(cls) -> Dict[str, FormatPath]:
Expand Down
10 changes: 8 additions & 2 deletions linkml_runtime/utils/schemaview.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import sys
import uuid
import logging
import collections
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 All @@ -28,6 +29,7 @@
ENUMS = 'enums'
SUBSETS = 'subsets'
TYPES = 'types'
WINDOWS = sys.platform == 'win32'

CLASS_NAME = Union[ClassDefinitionName, str]
SLOT_NAME = Union[SlotDefinitionName, str]
Expand Down Expand Up @@ -304,7 +306,11 @@ 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))
if WINDOWS:
# This cannot be simplified. os.path.normpath() must be called before .as_posix()
i = PurePath(os.path.normpath(PurePath(sn).parent / i)).as_posix()
else:
i = os.path.normpath(str(Path(sn).parent / i))
todo.append(i)

# add item to closure
Expand Down
Loading