Skip to content

Commit

Permalink
Merge pull request #22 from casework/release-0.5.0
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
ajnelson-nist authored Dec 21, 2022
2 parents 37fa459 + 31c8a5a commit ab355b2
Show file tree
Hide file tree
Showing 21 changed files with 1,067 additions and 1,469 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version:
- '3.8'
- '3.11'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python virtualenv for Github runner
run: |
python -m pip install --upgrade pip
pip install virtualenv
- name: Start from clean state
run: make clean
- name: Run tests
run: make check
run: make PYTHON3=python check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.swp
.DS_Store
.git_submodule_init.done.log
.venv-pre-commit
__pycache__
build
dist
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dependencies/CASE-Examples-QC"]
path = dependencies/CASE-Examples-QC
url = https://github.com/ajnelson-nist/CASE-Examples-QC.git
[submodule "dependencies/CASE-Utilities-Python"]
path = dependencies/CASE-Utilities-Python
url = https://github.com/casework/CASE-Utilities-Python.git
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
64 changes: 36 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@

SHELL := /bin/bash

PYTHON3 ?= $(shell which python3.8 2>/dev/null || which python3.7 2>/dev/null || which python3.6 2>/dev/null || which python3)
ifeq ($(PYTHON3),)
$(error python3 not found)
endif
PYTHON3 ?= python3

# This recipe intentionally blank.
all:
all: \
.venv-pre-commit/var/.pre-commit-built.log

.PHONY: \
download
Expand All @@ -30,12 +27,38 @@ all:
cd dependencies \
&& git diff . \
| cat
git submodule init
git submodule update
git submodule update --init
$(MAKE) \
--directory dependencies/CASE-Utilities-Python \
.git_submodule_init.done.log
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: \
dependencies/CASE-Examples-QC/tests/ontology_vocabulary.txt
.git_submodule_init.done.log \
.venv-pre-commit/var/.pre-commit-built.log
$(MAKE) \
--directory tests \
check
Expand All @@ -50,34 +73,19 @@ clean:
clean
@#A full clean here erases test files and causes unnecessary rebuilding for the purposes of testing ExifTool mapping.
@rm -f \
dependencies/CASE-Examples-QC/.lib.done.log

dependencies/CASE-Examples-QC/tests/ontology_vocabulary.txt: \
.git_submodule_init.done.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory dependencies/CASE-Examples-QC \
.git_submodule_init.done.log \
.lib.done.log \
.venv.done.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory dependencies/CASE-Examples-QC/tests \
ontology_vocabulary.txt
test -r $@
dependencies/CASE-Utilities-Python/.lib.done.log

distclean: \
clean
@rm -f \
.git_submodule_init.done.log \
dependencies/CASE-Examples-QC/.lib.done.log \
dependencies/CASE-Examples-QC/lib/rdf-toolkit.jar
.git_submodule_init.done.log
@$(MAKE) \
--directory tests \
distclean

download: \
dependencies/CASE-Examples-QC/tests/ontology_vocabulary.txt
.git_submodule_init.done.log \
.venv-pre-commit/var/.pre-commit-built.log
$(MAKE) \
--directory tests \
download
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ This project follows [SEMVER 2.0.0](https://semver.org/) where versions are decl

## Ontology versions supported

This repository supports the CASE and UCO ontology versions that are linked as submodules in the [CASE Examples QC](https://github.com/ajnelson-nist/CASE-Examples-QC) repository. Currently, those are:
This repository supports the CASE and UCO ontology versions that are distributed with the [CASE-Utilities-Python repository](https://github.com/casework/CASE-Utilities-Python), at the newest version below a ceiling-pin in [setup.cfg](setup.cfg). Currently, those ontology versions are:

* CASE 0.3.0
* UCO 0.5.0

Classes and properties are tested for vocabulary conformance.
* CASE 1.1.0
* UCO 1.1.0


## Repository locations
Expand Down
Loading

0 comments on commit ab355b2

Please sign in to comment.