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

Issue 373: Upgrade rdf-toolkit and Java, and move call pattern to pre-commit #386

Draft
wants to merge 9 commits into
base: develop
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
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
distribution: 'temurin'
java-version: '11'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pre-commit Checks
run: |
pip -q install pre-commit
pre-commit run --all-files
- name: Start from clean state
run: make clean
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.jar
.*.ttl
.git_submodule_init.done.log
.lib.done.log
.venv-pre-commit
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/kchason/rdf-toolkit-action
rev: 0.2.0
hooks:
- id: rdf-toolkit-normalizer
args:
- --autofix
43 changes: 29 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

SHELL := /bin/bash

PYTHON3 ?= python3

all: \
.lib.done.log
$(MAKE) \
--directory ontology
.venv-pre-commit/var/.pre-commit-built.log

# This recipe guarantees that 'git submodule init' and 'git submodule update' have run at least once.
# The recipe avoids running 'git submodule update' more than once, in case a user is testing with the submodule at a different commit than what UCO tracks.
Expand All @@ -34,28 +34,43 @@ all: \
--directory lib
touch $@

# This virtual environment is meant to be built once and then persist, even through 'make clean'.
# If a recipe is written to remove this flag file, it should first run `pre-commit uninstall`.
.venv-pre-commit/var/.pre-commit-built.log:
rm -rf .venv-pre-commit
test -r .pre-commit-config.yaml \
|| (echo "ERROR:Makefile:pre-commit is expected to install for this repository, but .pre-commit-config.yaml does not seem to exist." >&2 ; exit 1)
$(PYTHON3) -m venv \
.venv-pre-commit
source .venv-pre-commit/bin/activate \
&& pip install \
--upgrade \
pip \
setuptools \
wheel
source .venv-pre-commit/bin/activate \
&& pip install \
pre-commit
source .venv-pre-commit/bin/activate \
&& pre-commit install
mkdir -p \
.venv-pre-commit/var
touch $@

check: \
.git_submodule_init.done.log \
.lib.done.log
$(MAKE) \
--directory ontology \
check
.venv-pre-commit/var/.pre-commit-built.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory tests \
check

clean: \
clean-tests \
clean-ontology
clean-tests
@rm -f \
.git_submodule_init.done.log \
.lib.done.log

clean-ontology:
@$(MAKE) \
--directory ontology \
clean

clean-tests:
@$(MAKE) \
--directory tests \
Expand Down
46 changes: 0 additions & 46 deletions lib/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion lib/rdf-toolkit.jar.sha512

This file was deleted.

55 changes: 0 additions & 55 deletions ontology/Makefile

This file was deleted.

Loading