Skip to content

Commit

Permalink
Merge branch 'main' into experimental-base-model-transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Oct 13, 2023
2 parents c0e4fbe + f939bfc commit 0673211
Show file tree
Hide file tree
Showing 2,513 changed files with 141,823 additions and 156,143 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Reformat with black and isort
ef566b7942153a2f29b626976bf04d15854f3cf1
33 changes: 33 additions & 0 deletions .github/workflows/check_external_links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check Sphinx external links
on:
pull_request:
schedule:
- cron: '0 5 * * 1' # at 05:00 UTC every Monday
workflow_dispatch:

jobs:
check-external-links:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2

- name: install
run: poetry install -E docs

- name: Build documentation.
run: |
cd docs/
poetry run sphinx-build -b linkcheck . _build | grep "broken"
3 changes: 2 additions & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

jobs:
docker:
if: github.repository == 'linkml/linkml'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -48,4 +49,4 @@ jobs:
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
22 changes: 19 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
pydantic-version: ["1", "2"]
exclude:
- os: windows-latest
python-version: "3.8"
- os: windows-latest
pydantic-version: "2"
- python-version: "3.8"
pydantic-version: "2"
- python-version: "3.9"
pydantic-version: "2"

# See https://github.com/snok/install-poetry#running-on-windows
defaults:
Expand Down Expand Up @@ -70,31 +77,40 @@ jobs:
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install pydantic
#----------------------------------------------
- name: Install Pydantic
run: poetry add pydantic@^${{ matrix.pydantic-version }}

#----------------------------------------------
# setup and install graphviz
#----------------------------------------------
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1

#----------------------------------------------
# Linting
# Linting & code quality
#----------------------------------------------
- name: Lint with black and isort
- name: Check common spelling errors
run: poetry run tox -e codespell
- name: Check with flake8
run: poetry run tox -e lint

#----------------------------------------------
# coverage report
#----------------------------------------------
- name: Generate coverage results
run: |
poetry run coverage run -m unittest discover
poetry run coverage run -m pytest
poetry run coverage xml
poetry run coverage report -m
shell: bash
#----------------------------------------------
# upload coverage results
#----------------------------------------------
- name: Upload coverage report
if: github.repository == 'linkml/linkml'
uses: codecov/codecov-action@v3.1.0
with:
name: codecov-results-${{ matrix.os }}-${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ output/
docs/_sources
docs/_modules
docs/_images
sphinx/_build/
sphinx/source/
docs/_build/
docs/source/

# Jekyll
Gemfile.lock
Expand Down
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude: __snapshots__
- id: check-yaml
exclude: __snapshots__
- id: check-toml
- id: trailing-whitespace
exclude: __snapshots__
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies:
- tomli
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV PYTHONFAULTHANDLER=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.2.1
POETRY_VERSION=1.6.0

# Install Poetry
RUN pip install "poetry==$POETRY_VERSION"
Expand All @@ -19,11 +19,15 @@ WORKDIR /code
COPY ./.git ./.git
COPY pyproject.toml poetry.lock README.md .
COPY linkml linkml/
RUN poetry build
RUN poetry build

#######################################
FROM python:3.9-slim-bullseye as runner

ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt update && apt install -y gcc musl-dev python3-dev && rm -rf /var/lib/apt/lists/*

RUN useradd --create-home linkmluser
WORKDIR /home/linkmluser
USER linkmluser
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ all-examples-%: examples/%.py examples/%.schema.json examples/%.shex examples
RUN=poetry run

test:
$(RUN) python -m unittest discover
$(RUN) pytest

## Example schema products
examples/%.py: examples/%.yaml
Expand Down Expand Up @@ -58,13 +58,13 @@ linkml/linter/config/datamodel/config.py: linkml/linter/config/datamodel/config.

TUTORIALS = 01 02 03 04 05 06 07 08 09 10
test-tutorials: $(patsubst %, test-tutorial-%, $(TUTORIALS))
test-tutorial-%: sphinx/intro/tutorial%.md
pipenv run python -m linkml.utils.execute_tutorial -d /tmp/tutorial $<
test-tutorial-%: docs/intro/tutorial%.md
$(RUN) python -m linkml.utils.execute_tutorial -d /tmp/tutorial $<

rtd:
cd sphinx && $(RUN) make html
cd docs && $(RUN) make html
deploy-rtd:
cd sphinx && $(RUN) make deploy
cd docs && $(RUN) make deploy

################################################
#### Commands for building the Docker image ####
Expand All @@ -86,7 +86,7 @@ docker-build-use-cache-dev:

docker-clean:
docker kill $(IM) || echo not running ;
docker rm $(IM) || echo not made
docker rm $(IM) || echo not made

docker-publish-no-build:
@docker push $(IM):$(VERSION) \
Expand All @@ -101,4 +101,4 @@ docker-publish: docker-build
&& docker push $(IM):latest

docker-run:
@docker run -v $(PWD):/work -w /work -ti $(IM):$(VERSION)
@docker run -v $(PWD):/work -w /work -ti $(IM):$(VERSION)
2 changes: 1 addition & 1 deletion SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ prefixes:
qud: http://qudt.org/1.1/schema/qudt#
```

The CURIE `wgs:lat` will exand to http://www.w3.org/2003/01/geo/wgs84_pos#lat.
The CURIE `wgs:lat` will expand to http://www.w3.org/2003/01/geo/wgs84_pos#lat.

* an external CURIE map specified via a [default_curi_maps](https://w3id.org/linkml/meta/default_curi_maps) section.

Expand Down
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://docs.codecov.com/docs/codecov-yaml
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These instructions are for the core developers of the LinkML framework.

Documentation source:

* [sphinx/ folder](https://github.com/linkml/linkml/tree/main/sphinx)
* [docs/ folder](https://github.com/linkml/linkml/tree/main/docs)
* deployed to: [https://linkml.io/linkml/](https://linkml.io/linkml/)

We use the sphinx framework.
Expand Down
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'linkml'
copyright = '2021, LinkML Authors'
copyright = '2021-2023, LinkML Authors'
author = 'LinkML Authors'


Expand Down Expand Up @@ -75,7 +75,12 @@
# Options for the linkcheck builder
linkcheck_ignore = [
'https://w3id.org/linkml/*',
'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5819722',
'https://doi.org/10.1093/database/bax105',
'https://github.com/linkml/prefixmaps/*#*',
'https://docs.google.com/presentation/d/*#*'
]


# Options for autosectionlabel
autosectionlabel_prefix_document = True

0 comments on commit 0673211

Please sign in to comment.