Skip to content

Commit 5073694

Browse files
authored
Merge pull request #60 from casework/release-0.6.0
Release 0.6.0
2 parents 33d9565 + 80d76ab commit 5073694

File tree

27 files changed

+18638
-71
lines changed

27 files changed

+18638
-71
lines changed

.github/workflows/cicd.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,33 @@ name: Continuous Integration
1313

1414
on:
1515
push:
16-
branches: [ main, develop ]
16+
branches:
17+
- main
18+
- develop
1719
pull_request:
18-
branches: [ main, develop ]
20+
branches:
21+
- main
22+
- develop
23+
release:
24+
types:
25+
- published
1926

2027
jobs:
2128
build:
2229

2330
runs-on: ubuntu-latest
2431
strategy:
2532
matrix:
26-
python-version: [ '3.7', '3.10' ]
33+
python-version:
34+
- '3.7'
35+
- '3.10'
2736

2837
steps:
2938
- uses: actions/checkout@v2
30-
- uses: actions/setup-java@v2
39+
- uses: actions/setup-java@v3
3140
with:
32-
distribution: 'adopt'
33-
java-version: '8'
41+
distribution: 'temurin'
42+
java-version: '11'
3443
- name: Set up Python ${{ matrix.python-version }}
3544
uses: actions/setup-python@v2
3645
with:
@@ -65,5 +74,5 @@ jobs:
6574
# If this commit is the result of a Git tag, push the wheel and tar packages
6675
# to the PyPi registry
6776
- name: Publish to PyPI
68-
if: startsWith(github.ref, 'refs/tags')
77+
if: github.event_name == 'release' && github.event.action == 'published'
6978
run: twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing --verbose dist/*

.pre-commit-config.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
repos:
2-
- repo: https://github.com/psf/black
2+
- repo: https://github.com/psf/black
33
rev: 22.3.0
44
hooks:
5-
- id: black
5+
- id: black
6+
- repo: https://github.com/pycqa/flake8
7+
rev: 4.0.1
8+
hooks:
9+
- id: flake8
10+
- repo: https://github.com/pycqa/isort
11+
rev: 5.10.1
12+
hooks:
13+
- id: isort
14+
name: isort (python)

case_utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#
1212
# We would appreciate acknowledgement if the software is used.
1313

14-
__version__ = "0.5.0"
14+
__version__ = "0.6.0"
1515

16-
from . import local_uuid
16+
from . import local_uuid # noqa: F401

case_utils/case_file/__init__.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
This module creates a graph object that provides a basic UCO characterization of a single file. The gathered metadata is among the more "durable" file characteristics, i.e. characteristics that would remain consistent when transferring a file between locations.
1616
"""
1717

18-
__version__ = "0.3.1"
18+
__version__ = "0.3.2"
1919

2020
import argparse
2121
import datetime
@@ -28,7 +28,14 @@
2828
import rdflib # type: ignore
2929

3030
import case_utils
31-
from case_utils.namespace import *
31+
from case_utils.namespace import (
32+
NS_RDF,
33+
NS_UCO_CORE,
34+
NS_UCO_OBSERVABLE,
35+
NS_UCO_TYPES,
36+
NS_UCO_VOCABULARY,
37+
NS_XSD,
38+
)
3239

3340
DEFAULT_PREFIX = "http://example.org/kb/"
3441

@@ -147,7 +154,7 @@ def create_file_node(
147154
sha1obj.update(buf)
148155
sha256obj.update(buf)
149156
sha512obj.update(buf)
150-
if not stashed_error is None:
157+
if stashed_error is not None:
151158
raise stashed_error
152159
current_hashdict = HashDict(
153160
byte_tally,
@@ -182,7 +189,7 @@ def create_file_node(
182189

183190
# Add confirmed hashes into graph.
184191
for key in successful_hashdict._fields:
185-
if not key in ("md5", "sha1", "sha256", "sha512"):
192+
if key not in ("md5", "sha1", "sha256", "sha512"):
186193
continue
187194
n_hash = rdflib.BNode()
188195
graph.add((n_contentdata_facet, NS_UCO_OBSERVABLE.hash, n_hash))
@@ -247,7 +254,7 @@ def main() -> None:
247254
serialize_kwargs["context"] = context_dictionary
248255

249256
node_iri = NS_BASE["file-" + case_utils.local_uuid.local_uuid()]
250-
n_file = create_file_node(
257+
create_file_node(
251258
graph,
252259
args.in_file,
253260
node_iri=node_iri,

case_utils/case_sparql_construct/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
This script executes a SPARQL CONSTRUCT query, returning a graph of the generated triples.
1616
"""
1717

18-
__version__ = "0.2.1"
18+
__version__ = "0.2.2"
1919

2020
import argparse
2121
import logging
@@ -26,8 +26,10 @@
2626
import rdflib.plugins.sparql # type: ignore
2727

2828
import case_utils.ontology
29-
30-
from case_utils.ontology.version_info import *
29+
from case_utils.ontology.version_info import (
30+
CURRENT_CASE_VERSION,
31+
built_version_choices_list,
32+
)
3133

3234
_logger = logging.getLogger(os.path.basename(__file__))
3335

@@ -81,7 +83,7 @@ def main() -> None:
8183
construct_query_text = None
8284
with open(args.in_sparql, "r") as in_fh:
8385
construct_query_text = in_fh.read().strip()
84-
assert not construct_query_text is None
86+
assert construct_query_text is not None
8587

8688
if "subClassOf" in construct_query_text:
8789
case_utils.ontology.load_subclass_hierarchy(

case_utils/case_sparql_select/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
Should a more complex query be necessary, an outer, wrapping SELECT query would let this script continue to function.
2727
"""
2828

29-
__version__ = "0.4.1"
29+
__version__ = "0.4.2"
3030

3131
import argparse
3232
import binascii
33-
import importlib.resources
3433
import logging
3534
import os
3635
import sys
@@ -39,8 +38,10 @@
3938
import rdflib.plugins.sparql # type: ignore
4039

4140
import case_utils.ontology
42-
43-
from case_utils.ontology.version_info import *
41+
from case_utils.ontology.version_info import (
42+
CURRENT_CASE_VERSION,
43+
built_version_choices_list,
44+
)
4445

4546
NS_XSD = rdflib.XSD
4647

case_utils/case_validate/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@
2929
details.)
3030
"""
3131

32-
__version__ = "0.1.1"
32+
__version__ = "0.1.2"
3333

3434
import argparse
3535
import importlib.resources
3636
import logging
3737
import os
38-
import pathlib
3938
import sys
4039
import typing
4140

42-
import rdflib.util # type: ignore
4341
import pyshacl # type: ignore
42+
import rdflib.util # type: ignore
4443

4544
import case_utils.ontology
46-
47-
from case_utils.ontology.version_info import *
45+
from case_utils.ontology.version_info import (
46+
CURRENT_CASE_VERSION,
47+
built_version_choices_list,
48+
)
4849

4950
_logger = logging.getLogger(os.path.basename(__file__))
5051

case_utils/local_uuid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import pathlib
2323
import sys
2424
import typing
25-
import warnings
2625
import uuid
26+
import warnings
2727

2828
DEMO_UUID_BASE: typing.Optional[str] = None
2929

case_utils/ontology/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ case_srcdir := $(top_srcdir)/dependencies/CASE
1919

2020
uco_srcdir := $(case_srcdir)/dependencies/UCO
2121

22-
RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar
22+
RDF_TOOLKIT_JAR := $(uco_srcdir)/lib/rdf-toolkit.jar
2323

2424
case_version := $(shell python3 version_info.py)
2525

case_utils/ontology/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# We would appreciate acknowledgement if the software is used.
1313

14-
__version__ = "0.1.0"
14+
__version__ = "0.1.1"
1515

1616
import importlib.resources
1717
import logging
@@ -22,7 +22,7 @@
2222
# Yes, this next import is self-referential (/circular). But, it does work with importlib.
2323
import case_utils.ontology
2424

25-
from .version_info import *
25+
from .version_info import CURRENT_CASE_VERSION
2626

2727
_logger = logging.getLogger(os.path.basename(__file__))
2828

0 commit comments

Comments
 (0)