Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change dependency retrievals #75

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ catalog-v001.xml
.*.swp

# Workflow files
*.jar
.*.done.log
.venv-pre-commit
venv
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 1 addition & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -57,12 +52,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'.
Expand Down Expand Up @@ -102,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: \
Expand Down
44 changes: 9 additions & 35 deletions examples/illustrations/src/illustration-nosrc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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: \
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
case_utils >= 0.4.0, < 0.6.0
pytest