Skip to content

Release 0.6.0 #60

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

Merged
merged 14 commits into from
Jun 17, 2022
Merged
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
23 changes: 16 additions & 7 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,33 @@ name: Continuous Integration

on:
push:
branches: [ main, develop ]
branches:
- main
- develop
pull_request:
branches: [ main, develop ]
branches:
- main
- develop
release:
types:
- published

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.10' ]
python-version:
- '3.7'
- '3.10'

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:
Expand Down Expand Up @@ -65,5 +74,5 @@ jobs:
# If this commit is the result of a Git tag, push the wheel and tar packages
# to the PyPi registry
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
if: github.event_name == 'release' && github.event.action == 'published'
run: twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing --verbose dist/*
13 changes: 11 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
repos:
- repo: https://github.com/psf/black
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
4 changes: 2 additions & 2 deletions case_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#
# We would appreciate acknowledgement if the software is used.

__version__ = "0.5.0"
__version__ = "0.6.0"

from . import local_uuid
from . import local_uuid # noqa: F401
17 changes: 12 additions & 5 deletions case_utils/case_file/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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.
"""

__version__ = "0.3.1"
__version__ = "0.3.2"

import argparse
import datetime
Expand All @@ -28,7 +28,14 @@
import rdflib # type: ignore

import case_utils
from case_utils.namespace import *
from case_utils.namespace import (
NS_RDF,
NS_UCO_CORE,
NS_UCO_OBSERVABLE,
NS_UCO_TYPES,
NS_UCO_VOCABULARY,
NS_XSD,
)

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

Expand Down Expand Up @@ -147,7 +154,7 @@ def create_file_node(
sha1obj.update(buf)
sha256obj.update(buf)
sha512obj.update(buf)
if not stashed_error is None:
if stashed_error is not None:
raise stashed_error
current_hashdict = HashDict(
byte_tally,
Expand Down Expand Up @@ -182,7 +189,7 @@ def create_file_node(

# Add confirmed hashes into graph.
for key in successful_hashdict._fields:
if not key in ("md5", "sha1", "sha256", "sha512"):
if key not in ("md5", "sha1", "sha256", "sha512"):
continue
n_hash = rdflib.BNode()
graph.add((n_contentdata_facet, NS_UCO_OBSERVABLE.hash, n_hash))
Expand Down Expand Up @@ -247,7 +254,7 @@ def main() -> None:
serialize_kwargs["context"] = context_dictionary

node_iri = NS_BASE["file-" + case_utils.local_uuid.local_uuid()]
n_file = create_file_node(
create_file_node(
graph,
args.in_file,
node_iri=node_iri,
Expand Down
10 changes: 6 additions & 4 deletions case_utils/case_sparql_construct/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
This script executes a SPARQL CONSTRUCT query, returning a graph of the generated triples.
"""

__version__ = "0.2.1"
__version__ = "0.2.2"

import argparse
import logging
Expand All @@ -26,8 +26,10 @@
import rdflib.plugins.sparql # type: ignore

import case_utils.ontology

from case_utils.ontology.version_info import *
from case_utils.ontology.version_info import (
CURRENT_CASE_VERSION,
built_version_choices_list,
)

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

Expand Down Expand Up @@ -81,7 +83,7 @@ def main() -> None:
construct_query_text = None
with open(args.in_sparql, "r") as in_fh:
construct_query_text = in_fh.read().strip()
assert not construct_query_text is None
assert construct_query_text is not None

if "subClassOf" in construct_query_text:
case_utils.ontology.load_subclass_hierarchy(
Expand Down
9 changes: 5 additions & 4 deletions case_utils/case_sparql_select/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
Should a more complex query be necessary, an outer, wrapping SELECT query would let this script continue to function.
"""

__version__ = "0.4.1"
__version__ = "0.4.2"

import argparse
import binascii
import importlib.resources
import logging
import os
import sys
Expand All @@ -39,8 +38,10 @@
import rdflib.plugins.sparql # type: ignore

import case_utils.ontology

from case_utils.ontology.version_info import *
from case_utils.ontology.version_info import (
CURRENT_CASE_VERSION,
built_version_choices_list,
)

NS_XSD = rdflib.XSD

Expand Down
11 changes: 6 additions & 5 deletions case_utils/case_validate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,23 @@
details.)
"""

__version__ = "0.1.1"
__version__ = "0.1.2"

import argparse
import importlib.resources
import logging
import os
import pathlib
import sys
import typing

import rdflib.util # type: ignore
import pyshacl # type: ignore
import rdflib.util # type: ignore

import case_utils.ontology

from case_utils.ontology.version_info import *
from case_utils.ontology.version_info import (
CURRENT_CASE_VERSION,
built_version_choices_list,
)

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

Expand Down
2 changes: 1 addition & 1 deletion case_utils/local_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import pathlib
import sys
import typing
import warnings
import uuid
import warnings

DEMO_UUID_BASE: typing.Optional[str] = None

Expand Down
2 changes: 1 addition & 1 deletion case_utils/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ case_srcdir := $(top_srcdir)/dependencies/CASE

uco_srcdir := $(case_srcdir)/dependencies/UCO

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

case_version := $(shell python3 version_info.py)

Expand Down
4 changes: 2 additions & 2 deletions case_utils/ontology/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# We would appreciate acknowledgement if the software is used.

__version__ = "0.1.0"
__version__ = "0.1.1"

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

from .version_info import *
from .version_info import CURRENT_CASE_VERSION

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

Expand Down
Loading