Skip to content

Commit 0c55320

Browse files
authored
Merge pull request #292 from linkml/issue-1749-gh-actions
Issue 1749 gh actions - add once a week dependency check
2 parents c9972b4 + a39fd65 commit 0c55320

File tree

3 files changed

+68
-4
lines changed

3 files changed

+68
-4
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build and test linkml-runtime with latest dependency versions
2+
3+
on:
4+
schedule:
5+
- cron: '0 5 * * 1' # once per week on Monday at 05:00 UTC
6+
workflow_dispatch:
7+
# Allows you to run this workflow manually from the Actions tab
8+
types: trigger-run-check-dependencies
9+
10+
jobs:
11+
test:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, windows-latest]
16+
python-version: ["3.8", "3.9", "3.10"]
17+
exclude:
18+
- os: windows-latest
19+
python-version: "3.8"
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
25+
#----------------------------------------------
26+
# install poetry
27+
#----------------------------------------------
28+
- name: Install Poetry
29+
# Pin to 1.3.2 to workaround https://github.com/python-poetry/poetry/issues/7611
30+
run: pipx install poetry==1.3.2
31+
32+
#----------------------------------------------
33+
# check-out repo and set-up python
34+
#----------------------------------------------
35+
- name: Check out repository
36+
uses: actions/checkout@v3
37+
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
cache: 'poetry'
43+
44+
#----------------------------------------------
45+
# install your root project, if required
46+
#----------------------------------------------
47+
- name: Install library
48+
run: poetry install --no-interaction
49+
50+
# this step we remove and rebuild the poetry.lock file to ensure that the tests that follow can be run
51+
# with the latest dependencies
52+
53+
#----------------------------------------------
54+
# Remove and Rebuild the poetry.lock File
55+
#----------------------------------------------
56+
- name: Remove poetry.lock (Unix)
57+
if: runner.os != 'Windows'
58+
run: rm -rf poetry.lock
59+
60+
- name: Remove poetry.lock (Windows)
61+
if: runner.os == 'Windows'
62+
run: Remove-Item poetry.lock -Force
63+
64+
- name: Run tests
65+
run: poetry run python -m unittest discover

.github/workflows/main.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, windows-latest]
15-
python-version: ["3.7", "3.8", "3.9", "3.10"]
15+
python-version: ["3.8", "3.9", "3.10"]
1616
exclude:
17-
- os: windows-latest
18-
python-version: "3.7"
1917
- os: windows-latest
2018
python-version: "3.8"
2119

linkml_runtime/loaders/yaml_loader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from linkml_runtime.utils.yamlutils import YAMLRoot, DupCheckYamlLoader
1010
from pydantic import BaseModel
1111

12+
1213
class YAMLLoader(Loader):
1314
"""
1415
A Loader that is capable of instantiating LinkML data objects from a YAML file
@@ -34,7 +35,7 @@ def load_as_dict(self,
3435

3536
def load_any(self,
3637
source: Union[str, dict, TextIO],
37-
target_class: Union[Type[YAMLRoot],Type[BaseModel]],
38+
target_class: Union[Type[YAMLRoot], Type[BaseModel]],
3839
*, base_dir: Optional[str] = None,
3940
metadata: Optional[FileInfo] = None, **_) -> Union[YAMLRoot, List[YAMLRoot]]:
4041
data_as_dict = self.load_as_dict(source, base_dir=base_dir, metadata=metadata)

0 commit comments

Comments
 (0)