From 13375f14d00f8de06553c2176d3033641851351c Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 31 May 2022 10:16:55 -0400 Subject: [PATCH 1/4] Bump case-utils to 0.5.0 --- dependencies/CASE-Utilities-Python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/CASE-Utilities-Python b/dependencies/CASE-Utilities-Python index 1521663a..33d95650 160000 --- a/dependencies/CASE-Utilities-Python +++ b/dependencies/CASE-Utilities-Python @@ -1 +1 @@ -Subproject commit 1521663a7019ccc97e2039899815337052e3b6f5 +Subproject commit 33d9565047549e7da2e359526164ee87410feb53 From b3a5e113722f61544a1eb5ac8637b4df7f6b7982 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 31 May 2022 10:23:10 -0400 Subject: [PATCH 2/4] Call rdf-toolkit via pre-commit References: * https://github.com/ucoProject/UCO/issues/373 Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 6 +++ Makefile | 6 --- .../illustrations/src/illustration-nosrc.mk | 44 ++++--------------- 3 files changed, 15 insertions(+), 41 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 339017a6..6aee99af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,9 @@ repos: - --indent=4 - --no-ensure-ascii - --no-sort-keys +- repo: https://github.com/kchason/rdf-toolkit-action + rev: 0.1.2 + hooks: + - id: rdf-toolkit-normalizer + args: + - --autofix diff --git a/Makefile b/Makefile index e2c8838a..88932767 100644 --- a/Makefile +++ b/Makefile @@ -57,12 +57,6 @@ all: \ || (git submodule init dependencies/UCO-unstable && git submodule update dependencies/UCO-unstable) test -r dependencies/UCO-unstable/README.md \ || (echo "ERROR:Makefile:UCO-unstable submodule README.md file not found, even though UCO-unstable submodule initialized." >&2 ; exit 2) - # Retrieve rdf-toolkit.jar. - cd dependencies/CASE-Utilities-Python \ - && git submodule update --init dependencies/CASE - $(MAKE) \ - --directory dependencies/CASE-Utilities-Python/dependencies/CASE \ - .lib.done.log touch $@ # This virtual environment is meant to be built once and then persist, even through 'make clean'. diff --git a/examples/illustrations/src/illustration-nosrc.mk b/examples/illustrations/src/illustration-nosrc.mk index 29130829..6000d4e1 100644 --- a/examples/illustrations/src/illustration-nosrc.mk +++ b/examples/illustrations/src/illustration-nosrc.mk @@ -23,8 +23,6 @@ SHELL := /bin/bash # The expected execution context is in any sibling directory of this Makefile's directory. top_srcdir := $(shell cd ../../.. ; pwd) -RDF_TOOLKIT_JAR := $(top_srcdir)/dependencies/CASE-Utilities-Python/dependencies/CASE/lib/rdf-toolkit.jar - example_name := $(shell basename $$PWD) # Use a drafting.ttl file in the validation and dependency list, if it is present. @@ -42,78 +40,54 @@ all: \ $(example_name)_validation.ttl: \ $(example_name).json \ - $(RDF_TOOLKIT_JAR) \ $(drafting_ttl) \ $(top_srcdir)/.venv.done.log - rm -f __$@ + rm -f _$@ source $(top_srcdir)/venv/bin/activate \ && case_validate \ --format turtle \ $(drafting_validation_flag) \ - --output __$@ \ + --output _$@ \ $< \ $(drafting_ttl) \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - test -s __$@ - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ + test -s _$@ mv _$@ $@ $(example_name)_validation-develop.ttl: \ $(example_name).json \ - $(RDF_TOOLKIT_JAR) \ $(drafting_ttl) \ $(top_srcdir)/.venv.done.log \ $(top_srcdir)/dependencies/CASE-develop.ttl - rm -f __$@ + rm -f _$@ source $(top_srcdir)/venv/bin/activate \ && case_validate \ --built-version none \ --format turtle \ $(drafting_validation_flag) \ --ontology-graph $(top_srcdir)/dependencies/CASE-develop.ttl \ - --output __$@ \ + --output _$@ \ $< \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - test -s __$@ - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ + test -s _$@ mv _$@ $@ $(example_name)_validation-unstable.ttl: \ $(example_name).json \ - $(RDF_TOOLKIT_JAR) \ $(drafting_ttl) \ $(top_srcdir)/.venv.done.log \ $(top_srcdir)/dependencies/CASE-unstable.ttl - rm -f __$@ + rm -f _$@ source $(top_srcdir)/venv/bin/activate \ && case_validate \ --built-version none \ --format turtle \ $(drafting_validation_flag) \ --ontology-graph $(top_srcdir)/dependencies/CASE-unstable.ttl \ - --output __$@ \ + --output _$@ \ $< \ ; rc=$$? ; test 0 -eq $$rc -o 1 -eq $$rc - test -s __$@ - java -jar $(RDF_TOOLKIT_JAR) \ - --inline-blank-nodes \ - --source __$@ \ - --source-format turtle \ - --target _$@ \ - --target-format turtle - rm __$@ + test -s _$@ mv _$@ $@ check: \ From 555b70cd16f1b1cf9b774ead55ccb020c41ceccc Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 31 May 2022 10:43:54 -0400 Subject: [PATCH 3/4] Ignore review artifact Signed-off-by: Alex Nelson --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 553aac46..8418dd5e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ catalog-v001.xml .*.swp # Workflow files +*.jar .*.done.log .venv-pre-commit venv From 6e42541649ee57404cf21009f6f39933da283f19 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 31 May 2022 10:57:58 -0400 Subject: [PATCH 4/4] Import case-utils via PyPI instead of Git submodule Signed-off-by: Alex Nelson --- Makefile | 10 +--------- requirements.txt | 1 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 88932767..949e8625 100644 --- a/Makefile +++ b/Makefile @@ -32,11 +32,6 @@ all: \ # for someone developing with different submodule pointers. .git_submodule_init.done.log: \ .gitmodules - # CASE-Utilities-Python - test -r dependencies/CASE-Utilities-Python/README.md \ - || (git submodule init dependencies/CASE-Utilities-Python && git submodule update dependencies/CASE-Utilities-Python) - test -r dependencies/CASE-Utilities-Python/README.md \ - || (echo "ERROR:Makefile:CASE-Utilities-Python submodule README.md file not found, even though CASE-Utilities-Python submodule initialized." >&2 ; exit 2) # CASE-develop test -r dependencies/CASE-develop/README.md \ || (git submodule init dependencies/CASE-develop && git submodule update dependencies/CASE-develop) @@ -96,10 +91,7 @@ all: \ wheel source venv/bin/activate \ && pip install \ - dependencies/CASE-Utilities-Python - source venv/bin/activate \ - && pip install \ - --requirement requirements.txt + --requirement requirements.txt touch $@ check: \ diff --git a/requirements.txt b/requirements.txt index e079f8a6..0706ce5c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +case_utils >= 0.4.0, < 0.6.0 pytest