Skip to content

Commit 2acd014

Browse files
committed
Merge branch 'main' into test_type_annotations
2 parents da9a103 + fa4f7a9 commit 2acd014

File tree

8 files changed

+190
-109
lines changed

8 files changed

+190
-109
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: Install Dependencies
2626
run: |
27-
pip -q install poetry pre-commit
27+
pip -q install poetry pre-commit rdflib
2828
poetry install
2929
3030
- name: Pre-commit Checks
@@ -34,7 +34,7 @@ jobs:
3434
run: poetry run mypy case_mapping example.py tests
3535

3636
- name: Unit Tests
37-
run: poetry run pytest
37+
run: poetry run pytest --doctest-modules
3838

3939
- name: Run Example
4040
run: poetry run python example.py > case.jsonld
@@ -47,6 +47,11 @@ jobs:
4747
case-version: "case-1.3.0"
4848
extension-filter: "jsonld"
4949

50+
- name: Convert example
51+
run: |
52+
rdfpipe --output-format turtle case.jsonld > case.ttl
53+
test 0 -eq $(grep 'file:' case.ttl | wc -l) || (echo "ERROR:ci.yml:Some graph IRIs do not supply a resolving prefix. Look for the string 'file:///' in the file case.ttl (created by running 'make check') to see these instances." >&2 ; exit 1)
54+
5055
# Always build the package as a sanity check to ensure no issues with the build system
5156
# exist as part of the CI process
5257
- name: Build Package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ __pycache__/
1919
# Build Artifacts
2020
build/
2121
dist/
22+
case.ttl

Makefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,30 @@ case.jsonld: \
8484
_$@
8585
mv _$@ $@
8686

87+
case.ttl: \
88+
case.jsonld
89+
source venv/bin/activate \
90+
&& rdfpipe \
91+
--output-format turtle \
92+
$< \
93+
> _$@
94+
source venv/bin/activate \
95+
&& case_validate \
96+
_$@
97+
@# In instances where graph nodes omit use of a prefix, a 'default' prefix-base is used that incorporates the local directory as a file URL. This is likely to be an undesired behavior, so for the generated example JSON-LD in the top source directory, check that "file:///" doesn't start any of the graph individuals' IRIs.
98+
test \
99+
0 \
100+
-eq \
101+
$$(grep 'file:' _$@ | wc -l) \
102+
|| ( echo "ERROR:Makefile:Some graph IRIs do not supply a resolving prefix. Look for the string 'file:///' in the file _$@ to see these instances." >&2 ; exit 1)
103+
mv _$@ $@
104+
87105
check: \
88106
all \
89-
check-mypy
107+
check-mypy \
108+
case.ttl
90109
source venv/bin/activate \
91-
&& poetry run pytest
110+
&& poetry run pytest --doctest-modules
92111

93112
check-mypy: \
94113
.venv.done.log

0 commit comments

Comments
 (0)