From 05792437e27fbdd4fec5aaa64c71100af88a1bc5 Mon Sep 17 00:00:00 2001 From: Sierra Taylor Moxon Date: Fri, 1 Dec 2023 17:21:16 -0800 Subject: [PATCH] windoze support - hopefully --- .github/workflows/check-dependencies.yaml | 21 ++++++++++++--------- linkml_runtime/loaders/yaml_loader.py | 3 ++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check-dependencies.yaml b/.github/workflows/check-dependencies.yaml index 333dd143..d208a5ef 100644 --- a/.github/workflows/check-dependencies.yaml +++ b/.github/workflows/check-dependencies.yaml @@ -1,8 +1,4 @@ -# Built from: -# https://docs.github.com/en/actions/guides/building-and-testing-python -# https://github.com/actions/setup-python/ - -name: Build and test linkml-runtime +name: Build and test linkml-runtime package dependencies on: [pull_request] @@ -50,10 +46,17 @@ jobs: # this step we remove and rebuild the poetry.lock file to ensure that the tests that follow can be run # with the latest dependencies - - name: Install dependencies - run: | - rm -rf poetry.lock - poetry install + + #---------------------------------------------- + # Remove and Rebuild the poetry.lock File + #---------------------------------------------- + - name: Remove poetry.lock (Unix) + if: runner.os != 'Windows' + run: rm -rf poetry.lock + + - name: Remove poetry.lock (Windows) + if: runner.os == 'Windows' + run: Remove-Item poetry.lock -Force - name: Run tests run: poetry run python -m unittest discover \ No newline at end of file diff --git a/linkml_runtime/loaders/yaml_loader.py b/linkml_runtime/loaders/yaml_loader.py index cf53be9b..eee6e973 100644 --- a/linkml_runtime/loaders/yaml_loader.py +++ b/linkml_runtime/loaders/yaml_loader.py @@ -9,6 +9,7 @@ from linkml_runtime.utils.yamlutils import YAMLRoot, DupCheckYamlLoader from pydantic import BaseModel + class YAMLLoader(Loader): """ A Loader that is capable of instantiating LinkML data objects from a YAML file @@ -34,7 +35,7 @@ def load_as_dict(self, def load_any(self, source: Union[str, dict, TextIO], - target_class: Union[Type[YAMLRoot],Type[BaseModel]], + target_class: Union[Type[YAMLRoot], Type[BaseModel]], *, base_dir: Optional[str] = None, metadata: Optional[FileInfo] = None, **_) -> Union[YAMLRoot, List[YAMLRoot]]: data_as_dict = self.load_as_dict(source, base_dir=base_dir, metadata=metadata)