Skip to content

Commit a4eb2f8

Browse files
Merge branch 'main' into csv-test
2 parents 0c26089 + ff268a3 commit a4eb2f8

File tree

288 files changed

+21092
-12812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+21092
-12812
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ exclude_lines =
1111
ignore_errors = True
1212
omit =
1313
tests/*
14+
linkml_runtime/linkml_model/*

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Check https://editorconfig.org for more information
2+
# This is the main config file for this project:
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
trim_trailing_whitespace = true
12+
13+
[*.py]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.py.jinja]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.md]
22+
trim_trailing_whitespace = false

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: "/"
8+
schedule:
9+
interval: monthly
10+
11+
- package-ecosystem: "uv"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
day: "sunday"
16+
groups:
17+
# Individual pull requests for major/minor updates and grouped for patch updates
18+
dependencies:
19+
applies-to: version-updates
20+
patterns:
21+
- "*"
22+
update-types:
23+
- "patch"
24+
open-pull-requests-limit: 10
Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Build and test linkml-runtime with latest dependency versions
2-
2+
env:
3+
UV_VERSION: "0.7.13"
34
on:
45
schedule:
56
- cron: '0 5 * * 1' # once per week on Monday at 05:00 UTC
@@ -8,58 +9,66 @@ on:
89
types: trigger-run-check-dependencies
910

1011
jobs:
12+
quality-checks:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5.0.0
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6.8.0
18+
with:
19+
version: ${{ env.UV_VERSION }}
20+
enable-cache: true
21+
- uses: actions/setup-python@v6.0.0
22+
with:
23+
python-version: 3.13
24+
- name: Install tox
25+
run: python -m pip install tox
26+
- name: Run codespell
27+
run: tox -e codespell
28+
- name: Run code quality checks
29+
run: tox -e lint
30+
1131
test:
32+
needs:
33+
- quality-checks
1234
strategy:
1335
fail-fast: false
1436
matrix:
1537
os: [ubuntu-latest, windows-latest]
16-
python-version: ["3.8", "3.9", "3.10"]
38+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1739
exclude:
1840
- os: windows-latest
19-
python-version: "3.8"
41+
python-version: "3.10"
42+
- os: windows-latest
43+
python-version: "3.11"
44+
- os: windows-latest
45+
python-version: "3.12"
2046

2147
runs-on: ${{ matrix.os }}
2248

2349
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
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v6.8.0
4052
with:
53+
enable-cache: true
54+
version: ${{ env.UV_VERSION }}
4155
python-version: ${{ matrix.python-version }}
42-
cache: 'poetry'
4356

44-
#----------------------------------------------
45-
# install your root project, if required
46-
#----------------------------------------------
47-
- name: Install library
48-
run: poetry install --no-interaction
4957

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
58+
- name: Check out repository
59+
uses: actions/checkout@v5.0.0
60+
with:
61+
# Fetch all history for all branches and all tags.
62+
# The tags are required for dynamic versioning.
63+
fetch-depth: 0
5264

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
65+
- name: Regenerate lock file with latest dependencies
66+
run: uv lock --upgrade
5967

60-
- name: Remove poetry.lock (Windows)
61-
if: runner.os == 'Windows'
62-
run: Remove-Item poetry.lock -Force
68+
- name: Install dependencies
69+
run: uv sync --group dev
6370

6471
- name: Run tests
65-
run: poetry run python -m unittest discover
72+
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
73+
shell: bash
74+
run: uv run -m pytest --with-slow

.github/workflows/main.yaml

Lines changed: 63 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,104 @@
11
# Built from:
2-
# https://docs.github.com/en/actions/guides/building-and-testing-python
2+
# https://github.com/actions/checkout/
33
# https://github.com/actions/setup-python/
4+
# https://github.com/codecov/codecov-action
45

56
name: Build and test linkml-runtime
6-
7+
env:
8+
UV_VERSION: "0.7.13"
79
on:
810
push:
911
branches:
10-
- main
12+
- main
1113
pull_request:
1214
workflow_dispatch:
1315

1416
jobs:
17+
quality-checks:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5.0.0
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6.8.0
23+
with:
24+
version: ${{ env.UV_VERSION }}
25+
enable-cache: true
26+
- uses: actions/setup-python@v6.0.0
27+
with:
28+
python-version: 3.13
29+
- name: Install tox
30+
run: python -m pip install tox
31+
- name: Run codespell
32+
run: tox -e codespell
33+
- name: Run code format checks
34+
run: tox -e format_check
35+
1536
test:
37+
needs:
38+
- quality-checks
1639
strategy:
1740
fail-fast: false
1841
matrix:
1942
os: [ubuntu-latest, windows-latest]
20-
python-version: ["3.9", "3.10", "3.12", "3.13"]
43+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
44+
# Test on Windows with only the oldest and newest Python versions
2145
exclude:
22-
- os: windows-latest
23-
python-version: "3.10"
24-
- os: windows-latest
25-
python-version: "3.12"
46+
- os: windows-latest
47+
python-version: "3.10"
48+
- os: windows-latest
49+
python-version: "3.11"
50+
- os: windows-latest
51+
python-version: "3.12"
52+
# See https://github.com/snok/install-poetry#running-on-windows
53+
defaults:
54+
run:
55+
shell: bash
2656

2757
runs-on: ${{ matrix.os }}
28-
58+
2959
steps:
60+
- name: Check out repository
61+
uses: actions/checkout@v5.0.0
62+
with:
63+
fetch-depth: 0
3064

3165
#----------------------------------------------
32-
# install poetry
33-
#----------------------------------------------
34-
- name: Install Poetry
35-
run: pipx install poetry==1.4.0
36-
66+
# install uv
3767
#----------------------------------------------
38-
# check-out repo and set-up python
39-
#----------------------------------------------
40-
- name: Check out repository
41-
uses: actions/checkout@v3
42-
43-
- name: Set up Python ${{ matrix.python-version }}
44-
uses: actions/setup-python@v5
68+
- name: Install uv
69+
uses: astral-sh/setup-uv@v6.8.0
4570
with:
71+
version: ${{ env.UV_VERSION }}
72+
enable-cache: true
73+
cache-dependency-glob: "uv.lock"
4674
python-version: ${{ matrix.python-version }}
47-
cache: 'poetry'
4875

4976
#----------------------------------------------
50-
# install your root project, if required
51-
#----------------------------------------------
52-
- name: Install library
53-
run: poetry install --no-interaction
77+
# install your root project, if required
78+
#----------------------------------------------
79+
- name: Install dependencies
80+
run: |
81+
uv sync --group dev
82+
83+
- name: Verify uv.lock is up-to-date
84+
run: uv lock --check
5485

5586
#----------------------------------------------
56-
# coverage report
87+
# coverage report
5788
#----------------------------------------------
5889
- name: Generate coverage results
59-
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
90+
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
6091
shell: bash
6192
run: |
62-
poetry run coverage run -m pytest
63-
poetry run coverage xml
64-
poetry run coverage report -m
93+
uv run coverage run -m pytest
94+
uv run coverage xml
95+
uv run coverage report -m
6596
6697
#----------------------------------------------
6798
# upload coverage results
6899
#----------------------------------------------
69100
- name: Upload coverage report
70-
uses: codecov/codecov-action@v3
101+
uses: codecov/codecov-action@v5.5.1
71102
with:
72103
name: codecov-results-${{ matrix.os }}-${{ matrix.python-version }}
73104
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,62 @@
11
name: Publish Python Package
2-
2+
# Upload to PyPI is triggered by creating & publishing a release in GitHub UI
3+
env:
4+
UV_VERSION: "0.7.13"
35
on:
46
release:
7+
# Trigger the workflow only for real releases but not for draft releases
58
types: [created]
69

710
jobs:
8-
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI
11+
build:
12+
name: Build Python 🐍 distributions 📦 for publishing to PyPI
1013
runs-on: ubuntu-latest
11-
1214
steps:
13-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v5.0.0
16+
with:
17+
# Checkout the code including tags required for dynamic versioning
18+
fetch-depth: 0
1419

1520
- name: Set up Python
16-
uses: actions/setup-python@v2.2.2
21+
uses: actions/setup-python@v6.0.0
1722
with:
18-
python-version: 3.12
19-
20-
- name: Install Poetry
21-
run: pipx install poetry
23+
python-version: 3.13
2224

23-
- name: Install dependencies
24-
run: poetry install --no-interaction
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6.8.0
27+
with:
28+
enable-cache: true
29+
version: ${{ env.UV_VERSION }}
2530

2631
- name: Build source and wheel archives
2732
run: |
28-
poetry version $(git describe --tags --abbrev=0)
29-
poetry build
33+
uv build
3034
31-
- name: Publish distribution 📦 to PyPI
32-
uses: pypa/gh-action-pypi-publish@v1.2.2
35+
- name: Store built distribution
36+
uses: actions/upload-artifact@v4.6.2
3337
with:
34-
user: __token__
35-
password: ${{ secrets.pypi_password }}
38+
name: distribution-files
39+
path: dist/
40+
41+
pypi-publish:
42+
name: Build and publish Python 🐍 package 📦 to PyPI
43+
needs: build
44+
runs-on: ubuntu-latest
45+
# Uses trusted publishing. https://docs.pypi.org/trusted-publishers/adding-a-publisher/
46+
environment:
47+
name: pypi-release
48+
url: https://pypi.org/p/linkml-runtime
49+
permissions:
50+
id-token: write # This permission is mandatory for trusted publishing.
51+
steps:
52+
- name: Download built distribution
53+
uses: actions/download-artifact@v5.0.0
54+
with:
55+
name: distribution-files
56+
path: dist
57+
58+
- name: Publish package 📦 to PyPI
59+
if: github.event_name == 'release'
60+
uses: pypa/gh-action-pypi-publish@v1.13.0
61+
with:
62+
verbose: true

0 commit comments

Comments
 (0)