From ea630cce66b26dae6d7fa7e02451d6e25456a5f2 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Mon, 18 Dec 2023 14:54:06 -0500 Subject: [PATCH 01/28] Backport References: https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3 Signed-off-by: Alex Nelson --- case_utils/local_uuid.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/case_utils/local_uuid.py b/case_utils/local_uuid.py index dd1e6cb..8041343 100644 --- a/case_utils/local_uuid.py +++ b/case_utils/local_uuid.py @@ -32,9 +32,25 @@ _logger = logging.getLogger(pathlib.Path(__file__).name) +def _is_relative_to(p1: pathlib.Path, p2: pathlib.Path) -> bool: + """ + This function provides pathlib.is_relative_to to Pythons before 3.9. After the End of Life of Python 3.8, this function can be removed. + """ + if sys.version_info < (3, 9): + try: + _ = p1.relative_to(p2) + return True + except ValueError: + return False + else: + return p1.is_relative_to(p2) + + def configure() -> None: global DEMO_UUID_BASE + # _logger.debug("sys.argv = %r.", sys.argv) + if os.getenv("DEMO_UUID_REQUESTING_NONRANDOM") == "NONRANDOM_REQUESTED": warnings.warn( "Environment variable DEMO_UUID_REQUESTING_NONRANDOM is deprecated. See case_utils.local_uuid.demo_uuid for usage notes on its replacement, CASE_DEMO_NONRANDOM_UUID_BASE. Proceeding with random UUIDs.", @@ -82,18 +98,23 @@ def configure() -> None: demo_uuid_base_parts.append(sys.argv[0]) else: command_original_path = pathlib.Path(sys.argv[0]) + # _logger.debug("command_original_path = %r.", command_original_path) command_resolved_path = command_original_path.resolve() + # _logger.debug("command_resolved_path = %r.", command_resolved_path) + + # The command could be a command embedded in a virtual + # environment, or it could be a script external to any virtual + # environment. venv_original_path = pathlib.Path(env_venv_name) venv_resolved_path = venv_original_path.resolve() - try: + if _is_relative_to(command_resolved_path, venv_resolved_path): command_relative_path = command_resolved_path.relative_to( venv_resolved_path ) # _logger.debug("command_relative_path = %r.", command_relative_path) demo_uuid_base_parts.append(str(command_relative_path)) - except ValueError: - # _logger.debug("Command path is not relative to virtual environment path.") - demo_uuid_base_parts.append(str(command_resolved_path)) + else: + demo_uuid_base_parts.append(str(command_original_path)) if len(sys.argv) > 1: # Component: Arguments of argument vector. From b001b9a46059349921bd3b3c794f2f71c8e01076 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 11:11:25 -0500 Subject: [PATCH 02/28] Set rdflib ceiling for 0.5.x releases This patch isolates a change needed to get patch-releases atop 0.5.0 to pass `make check`. This patch alone will not pass `make check`; see the following octopus merge for a commit that passes `make check`. No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d8a7051..41faf11 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ include_package_data = true install_requires = pandas pyshacl - rdflib >= 6.0.2 + rdflib >= 6.0.2, < 6.3.0 requests tabulate packages = find: From e3c86856ba8a5800007e007c4ce1843470d45188 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 19 Dec 2023 10:33:44 -0500 Subject: [PATCH 03/28] Run and apply pre-commit autoupdate This patch isolates a change needed to get patch-releases atop 0.5.0 to pass Continuous Integration. This patch alone will not pass CI; see the following octopus merge for a commit that passes CI. No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 2 +- case_utils/case_file/__init__.py | 1 + case_utils/case_sparql_construct/__init__.py | 2 +- case_utils/case_sparql_select/__init__.py | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bf5f39..033942d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.12.0 hooks: - id: black diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py index 61e2bb7..9dfccbd 100644 --- a/case_utils/case_file/__init__.py +++ b/case_utils/case_file/__init__.py @@ -32,6 +32,7 @@ DEFAULT_PREFIX = "http://example.org/kb/" + # Shortcut syntax for defining an immutable named tuple is noted here: # https://docs.python.org/3/library/typing.html#typing.NamedTuple # via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple diff --git a/case_utils/case_sparql_construct/__init__.py b/case_utils/case_sparql_construct/__init__.py index 88c5877..723cfd4 100644 --- a/case_utils/case_sparql_construct/__init__.py +++ b/case_utils/case_sparql_construct/__init__.py @@ -96,7 +96,7 @@ def main() -> None: construct_query_result = in_graph.query(construct_query_object) _logger.debug("type(construct_query_result) = %r." % type(construct_query_result)) _logger.debug("len(construct_query_result) = %d." % len(construct_query_result)) - for (row_no, row) in enumerate(construct_query_result): + for row_no, row in enumerate(construct_query_result): if row_no == 0: _logger.debug("row[0] = %r." % (row,)) out_graph.add(row) diff --git a/case_utils/case_sparql_select/__init__.py b/case_utils/case_sparql_select/__init__.py index fcb58a0..fab92a2 100644 --- a/case_utils/case_sparql_select/__init__.py +++ b/case_utils/case_sparql_select/__init__.py @@ -109,10 +109,10 @@ def main() -> None: select_query_object = rdflib.plugins.sparql.prepareQuery( select_query_text, initNs=nsdict ) - for (row_no, row) in enumerate(graph.query(select_query_object)): + for row_no, row in enumerate(graph.query(select_query_object)): tally = row_no + 1 record = [] - for (column_no, column) in enumerate(row): + for column_no, column in enumerate(row): if column is None: column_value = "" elif ( From 63afdfc309793a16a806625c252f6bad6f8c98f7 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 11:28:44 -0500 Subject: [PATCH 04/28] Backport rdf-toolkit version as test library This patch isolates a change needed to get patch-releases atop 0.5.0 to pass `make check`. This patch alone will not pass `make check`; see the following octopus merge for a commit that passes `make check`. No effects were observed on Make-managed files. References: * https://github.com/ucoProject/UCO/issues/373 Signed-off-by: Alex Nelson --- .github/workflows/cicd.yml | 6 +-- tests/Makefile | 11 +++++- tests/case_utils/case_file/Makefile | 4 +- .../case_validate/case_test_examples/Makefile | 6 +-- tests/case_utils/case_validate/cli/Makefile | 2 +- .../case_validate/uco_test_examples/Makefile | 8 +--- tests/lib/.gitignore | 1 + tests/lib/Makefile | 38 +++++++++++++++++++ tests/lib/rdf-toolkit.jar.sha512 | 1 + 9 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 tests/lib/.gitignore create mode 100644 tests/lib/Makefile create mode 100644 tests/lib/rdf-toolkit.jar.sha512 diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 97df165..6bb1ea4 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -27,10 +27,10 @@ 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: diff --git a/tests/Makefile b/tests/Makefile index b75a75a..ab1d2b6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -22,6 +22,7 @@ all: \ .PHONY: \ all-case_utils \ + all-lib \ check-case_utils \ check-isomorphic_diff \ check-mypy \ @@ -53,10 +54,15 @@ all: \ touch $@ all-case_utils: \ - .venv.done.log + .venv.done.log \ + all-lib $(MAKE) \ --directory case_utils +all-lib: + $(MAKE) \ + --directory lib + # These check calls are provided in preferred run-order. check: \ check-mypy \ @@ -68,7 +74,8 @@ check: \ --log-level=DEBUG check-case_utils: \ - .venv.done.log + .venv.done.log \ + all-lib $(MAKE) \ --directory case_utils \ check diff --git a/tests/case_utils/case_file/Makefile b/tests/case_utils/case_file/Makefile index 0ce744a..a561325 100644 --- a/tests/case_utils/case_file/Makefile +++ b/tests/case_utils/case_file/Makefile @@ -17,9 +17,7 @@ top_srcdir := $(shell cd ../../.. ; pwd) tests_srcdir := $(top_srcdir)/tests -case_srcdir := $(top_srcdir)/dependencies/CASE - -RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar +RDF_TOOLKIT_JAR := $(tests_srcdir)/lib/rdf-toolkit.jar all: \ kb.json \ diff --git a/tests/case_utils/case_validate/case_test_examples/Makefile b/tests/case_utils/case_validate/case_test_examples/Makefile index 913bd3a..8dbfe44 100644 --- a/tests/case_utils/case_validate/case_test_examples/Makefile +++ b/tests/case_utils/case_validate/case_test_examples/Makefile @@ -15,13 +15,11 @@ SHELL := /bin/bash top_srcdir := $(shell cd ../../../.. ; pwd) -case_srcdir := $(top_srcdir)/dependencies/CASE - -examples_srcdir := $(case_srcdir)/tests/examples +examples_srcdir := $(top_srcdir)/dependencies/CASE/tests/examples tests_srcdir := $(top_srcdir)/tests -RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar +RDF_TOOLKIT_JAR := $(tests_srcdir)/lib/rdf-toolkit.jar all: \ investigative_action_PASS_validation.ttl \ diff --git a/tests/case_utils/case_validate/cli/Makefile b/tests/case_utils/case_validate/cli/Makefile index f61d421..5cfaeef 100644 --- a/tests/case_utils/case_validate/cli/Makefile +++ b/tests/case_utils/case_validate/cli/Makefile @@ -21,7 +21,7 @@ examples_srcdir := $(case_srcdir)/tests/examples tests_srcdir := $(top_srcdir)/tests -RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar +RDF_TOOLKIT_JAR := $(tests_srcdir)/lib/rdf-toolkit.jar files_to_generate := \ format_human_output_jsonld.jsonld \ diff --git a/tests/case_utils/case_validate/uco_test_examples/Makefile b/tests/case_utils/case_validate/uco_test_examples/Makefile index 08fa853..04a6dc3 100644 --- a/tests/case_utils/case_validate/uco_test_examples/Makefile +++ b/tests/case_utils/case_validate/uco_test_examples/Makefile @@ -15,15 +15,11 @@ SHELL := /bin/bash top_srcdir := $(shell cd ../../../.. ; pwd) -case_srcdir := $(top_srcdir)/dependencies/CASE - -uco_srcdir := $(case_srcdir)/dependencies/UCO - -examples_srcdir := $(uco_srcdir)/tests/examples +examples_srcdir := $(top_srcdir)/dependencies/CASE/dependencies/UCO/tests/examples tests_srcdir := $(top_srcdir)/tests -RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar +RDF_TOOLKIT_JAR := $(tests_srcdir)/lib/rdf-toolkit.jar all: \ action_inheritance_PASS_validation.ttl \ diff --git a/tests/lib/.gitignore b/tests/lib/.gitignore new file mode 100644 index 0000000..d392f0e --- /dev/null +++ b/tests/lib/.gitignore @@ -0,0 +1 @@ +*.jar diff --git a/tests/lib/Makefile b/tests/lib/Makefile new file mode 100644 index 0000000..75c4342 --- /dev/null +++ b/tests/lib/Makefile @@ -0,0 +1,38 @@ +#!/usr/bin/make -f + +# Portions of this file contributed by NIST are governed by the +# following statement: +# +# This software was developed at the National Institute of Standards +# and Technology by employees of the Federal Government in the course +# of their official duties. Pursuant to Title 17 Section 105 of the +# United States Code, this software is not subject to copyright +# protection within the United States. NIST assumes no responsibility +# whatsoever for its use by other parties, and makes no guarantees, +# expressed or implied, about its quality, reliability, or any other +# characteristic. +# +# We would appreciate acknowledgement if the software is used. + +# This Makefile is incorporated to support versions of case-utils since +# 0.5.0 that had not yet incorporated rdf-toolkit-1.11.0.jar into their +# testing process. The Makefile is adapted from the `/lib` directory of +# UCO at version 1.2.0. + +SHELL := /bin/bash + +all: \ + rdf-toolkit.jar + +rdf-toolkit.jar: + test -r rdf-toolkit.jar.sha512 + rm -f $@_ + # Try retrieval from files.caseontology.org. + wget \ + --output-document $@_ \ + https://files.caseontology.org/rdf-toolkit-1.11.0.jar + test \ + "x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \ + == \ + "x$$(head -n1 rdf-toolkit.jar.sha512)" + mv $@_ $@ diff --git a/tests/lib/rdf-toolkit.jar.sha512 b/tests/lib/rdf-toolkit.jar.sha512 new file mode 100644 index 0000000..39fbb64 --- /dev/null +++ b/tests/lib/rdf-toolkit.jar.sha512 @@ -0,0 +1 @@ +8131e5515da63f099a89a3ce2c7587fb6b228f1ec7c5eb49ff35710509e8511921bfc847e182ee994e575b1f7895c04ae5bed7e1b7826bb32c9475b43b74dc17 From 3df46fbf8ff97ceca622236e182ebf1c57b8f95d Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 13:12:28 -0500 Subject: [PATCH 05/28] Update Python usage to reflect 3.7 EOL This patch backports PR 99. This patch isolates a change needed to get patch-releases atop 0.5.0 to pass Continuous Integration. This patch alone will not pass CI; see the following octopus merge for a commit that passes CI. References: * https://github.com/casework/CASE-Utilities-Python/pull/99 Signed-off-by: Alex Nelson --- .github/workflows/cicd.yml | 4 +++- setup.cfg | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 97df165..8958230 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -23,7 +23,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.7', '3.10' ] + python-version: + - '3.8' + - '3.10' steps: - uses: actions/checkout@v2 diff --git a/setup.cfg b/setup.cfg index d8a7051..1bc1e0c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,7 @@ install_requires = requests tabulate packages = find: -python_requires = >=3.7 +python_requires = >=3.8 [options.entry_points] console_scripts = From b94941f6d892dc3e87156c21ca45680ed5d9ed29 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Tue, 19 Dec 2023 11:10:30 -0500 Subject: [PATCH 06/28] Run CI on support-* branches This enables release review for releases that precede the current release. This was found necessary from efforts on PR 145. Cherry pick extra effects: This patch also cleans up some dangling whitespace flagged by `git diff`. References: * https://github.com/casework/CASE-Utilities-Python/pull/145/ Signed-off-by: Alex Nelson (cherry picked from commit f560e2eed8d593d4379efe16d75b95bc2194f4b7) --- .github/workflows/cicd.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 7dbdfad..afe7ad2 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -13,9 +13,15 @@ name: Continuous Integration on: push: - branches: [ main, develop ] + branches: + - main + - develop + - support-* pull_request: - branches: [ main, develop ] + branches: + - main + - develop + - support-* jobs: build: @@ -45,7 +51,7 @@ jobs: run: make clean - name: Run tests run: make PYTHON3=python check - + # Build the binary wheel as well as the source tar - name: Build Objects run: | From 60938ef692f3a5f86fd6c8ad70a8805d2f90714d Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 13:29:29 -0500 Subject: [PATCH 07/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index e8bc7ac..b2eab35 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.5.0" +__version__ = "0.5.1" from . import local_uuid From 63de50e643532b79673ebeaaa0363206f4126f59 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 14:30:35 -0500 Subject: [PATCH 08/28] Run and apply pre-commit autoupdate This patch isolates a change needed to get patch-releases atop 0.6.0 to pass Continuous Integration. This patch alone will not pass CI; see the following octopus merge for a commit that passes CI. No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 6 +++--- case_utils/case_file/__init__.py | 1 + case_utils/case_sparql_construct/__init__.py | 2 +- case_utils/case_sparql_select/__init__.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c952e8e..a65fd04 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.12.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.13.2 hooks: - id: isort name: isort (python) diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py index e131b2f..2eb4f95 100644 --- a/case_utils/case_file/__init__.py +++ b/case_utils/case_file/__init__.py @@ -39,6 +39,7 @@ DEFAULT_PREFIX = "http://example.org/kb/" + # Shortcut syntax for defining an immutable named tuple is noted here: # https://docs.python.org/3/library/typing.html#typing.NamedTuple # via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple diff --git a/case_utils/case_sparql_construct/__init__.py b/case_utils/case_sparql_construct/__init__.py index eb9610f..a96f06b 100644 --- a/case_utils/case_sparql_construct/__init__.py +++ b/case_utils/case_sparql_construct/__init__.py @@ -98,7 +98,7 @@ def main() -> None: construct_query_result = in_graph.query(construct_query_object) _logger.debug("type(construct_query_result) = %r." % type(construct_query_result)) _logger.debug("len(construct_query_result) = %d." % len(construct_query_result)) - for (row_no, row) in enumerate(construct_query_result): + for row_no, row in enumerate(construct_query_result): if row_no == 0: _logger.debug("row[0] = %r." % (row,)) out_graph.add(row) diff --git a/case_utils/case_sparql_select/__init__.py b/case_utils/case_sparql_select/__init__.py index a2023bf..87e2b50 100644 --- a/case_utils/case_sparql_select/__init__.py +++ b/case_utils/case_sparql_select/__init__.py @@ -110,10 +110,10 @@ def main() -> None: select_query_object = rdflib.plugins.sparql.prepareQuery( select_query_text, initNs=nsdict ) - for (row_no, row) in enumerate(graph.query(select_query_object)): + for row_no, row in enumerate(graph.query(select_query_object)): tally = row_no + 1 record = [] - for (column_no, column) in enumerate(row): + for column_no, column in enumerate(row): if column is None: column_value = "" elif ( From 1f12e5747a865a689640585ca3ddcd700f07cf15 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 16:11:46 -0500 Subject: [PATCH 09/28] Set pyshacl ceiling for 0.7.x releases This patch isolates a change needed to get patch-releases atop 0.7.0 to pass `make check`. This patch alone will not pass `make check`; see the following octopus merge for a commit that passes `make check`. Signed-off-by: Alex Nelson --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 401504c..3e8384c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ license_files = include_package_data = true install_requires = pandas - pyshacl + pyshacl < 0.22.0 rdflib >= 6.2.0 requests tabulate From 99491ae07da7230da645cb1793c6dfb65e45e649 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 20 Dec 2023 17:42:46 -0500 Subject: [PATCH 10/28] Backport 'Switch release tracking logic' and 'Switch action check' This is a squashed commit of the non-syntax changes from PR 59. References: * https://github.com/casework/CASE-Utilities-Python/pull/59 Signed-off-by: Alex Nelson --- .github/workflows/cicd.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 97df165..4e1d61e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -16,6 +16,9 @@ on: branches: [ main, develop ] pull_request: branches: [ main, develop ] + release: + types: + - published jobs: build: @@ -65,5 +68,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/* From 9382ef79c5fbd0984be1601cb2e1e09ec333ec5c Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Thu, 21 Dec 2023 09:54:28 -0500 Subject: [PATCH 11/28] Bump version Signed-off-by: Alex Nelson --- case_utils/local_uuid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/local_uuid.py b/case_utils/local_uuid.py index 8041343..29d6f4b 100644 --- a/case_utils/local_uuid.py +++ b/case_utils/local_uuid.py @@ -15,7 +15,7 @@ This library is a wrapper for uuid, provided to generate repeatable UUIDs if requested. """ -__version__ = "0.3.0" +__version__ = "0.3.1" import logging import os From 3473e59f8ebd796482cf96ebf328e6d05a8c4787 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 09:50:40 -0500 Subject: [PATCH 12/28] Bump version References: * https://packaging.python.org/en/latest/specifications/version-specifiers/#post-release-separators Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index b2eab35..bdcd08b 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.5.1" +__version__ = "0.5.1.post0" from . import local_uuid From 92732233bb183bf9213fac4e835404d738942d10 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 10:34:41 -0500 Subject: [PATCH 13/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index be9c0fc..e967344 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.6.0" +__version__ = "0.6.1" from . import local_uuid # noqa: F401 From ea54c7a84a3e41f7f7859a8e51fc4640a0ccc801 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 10:38:51 -0500 Subject: [PATCH 14/28] Revert "Backport rdf-toolkit version as test library" This reverts commit 63afdfc309793a16a806625c252f6bad6f8c98f7. --- tests/Makefile | 11 ++---- tests/case_utils/case_validate/cli/Makefile | 2 +- tests/lib/.gitignore | 1 - tests/lib/Makefile | 38 --------------------- tests/lib/rdf-toolkit.jar.sha512 | 1 - 5 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 tests/lib/.gitignore delete mode 100644 tests/lib/Makefile delete mode 100644 tests/lib/rdf-toolkit.jar.sha512 diff --git a/tests/Makefile b/tests/Makefile index ab1d2b6..b75a75a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -22,7 +22,6 @@ all: \ .PHONY: \ all-case_utils \ - all-lib \ check-case_utils \ check-isomorphic_diff \ check-mypy \ @@ -54,15 +53,10 @@ all: \ touch $@ all-case_utils: \ - .venv.done.log \ - all-lib + .venv.done.log $(MAKE) \ --directory case_utils -all-lib: - $(MAKE) \ - --directory lib - # These check calls are provided in preferred run-order. check: \ check-mypy \ @@ -74,8 +68,7 @@ check: \ --log-level=DEBUG check-case_utils: \ - .venv.done.log \ - all-lib + .venv.done.log $(MAKE) \ --directory case_utils \ check diff --git a/tests/case_utils/case_validate/cli/Makefile b/tests/case_utils/case_validate/cli/Makefile index 5cfaeef..f61d421 100644 --- a/tests/case_utils/case_validate/cli/Makefile +++ b/tests/case_utils/case_validate/cli/Makefile @@ -21,7 +21,7 @@ examples_srcdir := $(case_srcdir)/tests/examples tests_srcdir := $(top_srcdir)/tests -RDF_TOOLKIT_JAR := $(tests_srcdir)/lib/rdf-toolkit.jar +RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar files_to_generate := \ format_human_output_jsonld.jsonld \ diff --git a/tests/lib/.gitignore b/tests/lib/.gitignore deleted file mode 100644 index d392f0e..0000000 --- a/tests/lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.jar diff --git a/tests/lib/Makefile b/tests/lib/Makefile deleted file mode 100644 index 75c4342..0000000 --- a/tests/lib/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/make -f - -# Portions of this file contributed by NIST are governed by the -# following statement: -# -# This software was developed at the National Institute of Standards -# and Technology by employees of the Federal Government in the course -# of their official duties. Pursuant to Title 17 Section 105 of the -# United States Code, this software is not subject to copyright -# protection within the United States. NIST assumes no responsibility -# whatsoever for its use by other parties, and makes no guarantees, -# expressed or implied, about its quality, reliability, or any other -# characteristic. -# -# We would appreciate acknowledgement if the software is used. - -# This Makefile is incorporated to support versions of case-utils since -# 0.5.0 that had not yet incorporated rdf-toolkit-1.11.0.jar into their -# testing process. The Makefile is adapted from the `/lib` directory of -# UCO at version 1.2.0. - -SHELL := /bin/bash - -all: \ - rdf-toolkit.jar - -rdf-toolkit.jar: - test -r rdf-toolkit.jar.sha512 - rm -f $@_ - # Try retrieval from files.caseontology.org. - wget \ - --output-document $@_ \ - https://files.caseontology.org/rdf-toolkit-1.11.0.jar - test \ - "x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \ - == \ - "x$$(head -n1 rdf-toolkit.jar.sha512)" - mv $@_ $@ diff --git a/tests/lib/rdf-toolkit.jar.sha512 b/tests/lib/rdf-toolkit.jar.sha512 deleted file mode 100644 index 39fbb64..0000000 --- a/tests/lib/rdf-toolkit.jar.sha512 +++ /dev/null @@ -1 +0,0 @@ -8131e5515da63f099a89a3ce2c7587fb6b228f1ec7c5eb49ff35710509e8511921bfc847e182ee994e575b1f7895c04ae5bed7e1b7826bb32c9475b43b74dc17 From 83865ea0fe23119fd9fc81962cedc558c10a255d Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 11:14:52 -0500 Subject: [PATCH 15/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index 5fc7116..dc64c96 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.7.0" +__version__ = "0.7.1" from . import local_uuid # noqa: F401 From 7141ddb667e5daaa81d20a0de615c1f984aa94c2 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 13:08:31 -0500 Subject: [PATCH 16/28] Run and apply pre-commit autoupdate This patch isolates a change needed to get patch-releases atop 0.6.0 to pass Continuous Integration. This patch alone will not pass CI; see the following octopus merge for a commit that passes CI. No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 6 +++--- case_utils/case_file/__init__.py | 1 + case_utils/case_sparql_construct/__init__.py | 2 +- case_utils/case_sparql_select/__init__.py | 4 ++-- case_utils/ontology/src/ontology_and_version_iris.py | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c952e8e..a65fd04 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.12.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.13.2 hooks: - id: isort name: isort (python) diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py index ec51a85..9a4095f 100644 --- a/case_utils/case_file/__init__.py +++ b/case_utils/case_file/__init__.py @@ -39,6 +39,7 @@ DEFAULT_PREFIX = "http://example.org/kb/" + # Shortcut syntax for defining an immutable named tuple is noted here: # https://docs.python.org/3/library/typing.html#typing.NamedTuple # via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple diff --git a/case_utils/case_sparql_construct/__init__.py b/case_utils/case_sparql_construct/__init__.py index 6c9826c..06cd8a4 100644 --- a/case_utils/case_sparql_construct/__init__.py +++ b/case_utils/case_sparql_construct/__init__.py @@ -98,7 +98,7 @@ def main() -> None: construct_query_result = in_graph.query(construct_query_object) _logger.debug("type(construct_query_result) = %r." % type(construct_query_result)) _logger.debug("len(construct_query_result) = %d." % len(construct_query_result)) - for (row_no, row) in enumerate(construct_query_result): + for row_no, row in enumerate(construct_query_result): if row_no == 0: _logger.debug("row[0] = %r." % (row,)) out_graph.add(row) diff --git a/case_utils/case_sparql_select/__init__.py b/case_utils/case_sparql_select/__init__.py index b753664..353a637 100644 --- a/case_utils/case_sparql_select/__init__.py +++ b/case_utils/case_sparql_select/__init__.py @@ -110,10 +110,10 @@ def main() -> None: select_query_object = rdflib.plugins.sparql.processor.prepareQuery( select_query_text, initNs=nsdict ) - for (row_no, row) in enumerate(graph.query(select_query_object)): + for row_no, row in enumerate(graph.query(select_query_object)): tally = row_no + 1 record = [] - for (column_no, column) in enumerate(row): + for column_no, column in enumerate(row): if column is None: column_value = "" elif ( diff --git a/case_utils/ontology/src/ontology_and_version_iris.py b/case_utils/ontology/src/ontology_and_version_iris.py index 74f2304..7ac429d 100644 --- a/case_utils/ontology/src/ontology_and_version_iris.py +++ b/case_utils/ontology/src/ontology_and_version_iris.py @@ -28,7 +28,8 @@ def concept_is_cdo_concept(n_concept: rdflib.URIRef) -> bool: """ - This function is purposefully distinct from the function used in case_validate. Within this script, the publishing history of CASE and UCO is reviewed.""" + This function is purposefully distinct from the function used in case_validate. Within this script, the publishing history of CASE and UCO is reviewed. + """ concept_iri = str(n_concept) return ( concept_iri.startswith("https://ontology.unifiedcyberontology.org/") From 6ec8b7471194bda5a677b5b8a2b93fa6bac83fe0 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 12:07:37 -0500 Subject: [PATCH 17/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index 99dc0f8..0c9a49e 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.8.0" +__version__ = "0.8.1" from . import local_uuid # noqa: F401 From 9f2dbe7f0ce02a2531e09ad3ea62b7483a43aadf Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 12:07:54 -0500 Subject: [PATCH 18/28] Lift pyshacl ceiling for 0.8.x releases No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 01a1c06..06ba2b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ license_files = include_package_data = true install_requires = pandas - pyshacl < 0.22.0 + pyshacl rdflib >= 6.2.0, < 6.3.0 requests tabulate From 7774dd901c20195047438de9175a56fb37ca44fb Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 13:31:13 -0500 Subject: [PATCH 19/28] Run and apply pre-commit autoupdate This patch isolates a change needed to get patch-releases atop 0.6.0 to pass Continuous Integration. This patch alone will not pass CI; see the following octopus merge for a commit that passes CI. No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- .pre-commit-config.yaml | 6 +++--- case_utils/case_file/__init__.py | 1 + case_utils/case_sparql_construct/__init__.py | 2 +- case_utils/case_sparql_select/__init__.py | 4 ++-- case_utils/ontology/src/ontology_and_version_iris.py | 3 ++- .../test_data_frame_to_table_text_json.py | 6 +++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6274fe..a65fd04 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ repos: - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.12.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.13.2 hooks: - id: isort name: isort (python) diff --git a/case_utils/case_file/__init__.py b/case_utils/case_file/__init__.py index ec51a85..9a4095f 100644 --- a/case_utils/case_file/__init__.py +++ b/case_utils/case_file/__init__.py @@ -39,6 +39,7 @@ DEFAULT_PREFIX = "http://example.org/kb/" + # Shortcut syntax for defining an immutable named tuple is noted here: # https://docs.python.org/3/library/typing.html#typing.NamedTuple # via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple diff --git a/case_utils/case_sparql_construct/__init__.py b/case_utils/case_sparql_construct/__init__.py index 6c9826c..06cd8a4 100644 --- a/case_utils/case_sparql_construct/__init__.py +++ b/case_utils/case_sparql_construct/__init__.py @@ -98,7 +98,7 @@ def main() -> None: construct_query_result = in_graph.query(construct_query_object) _logger.debug("type(construct_query_result) = %r." % type(construct_query_result)) _logger.debug("len(construct_query_result) = %d." % len(construct_query_result)) - for (row_no, row) in enumerate(construct_query_result): + for row_no, row in enumerate(construct_query_result): if row_no == 0: _logger.debug("row[0] = %r." % (row,)) out_graph.add(row) diff --git a/case_utils/case_sparql_select/__init__.py b/case_utils/case_sparql_select/__init__.py index 1e94265..4e5d6a2 100644 --- a/case_utils/case_sparql_select/__init__.py +++ b/case_utils/case_sparql_select/__init__.py @@ -86,10 +86,10 @@ def graph_and_query_to_data_frame( select_query_object = rdflib.plugins.sparql.processor.prepareQuery( select_query_text, initNs=nsdict ) - for (row_no, row) in enumerate(_graph.query(select_query_object)): + for row_no, row in enumerate(_graph.query(select_query_object)): tally = row_no + 1 record = [] - for (column_no, column) in enumerate(row): + for column_no, column in enumerate(row): if column is None: column_value = "" elif ( diff --git a/case_utils/ontology/src/ontology_and_version_iris.py b/case_utils/ontology/src/ontology_and_version_iris.py index 74f2304..7ac429d 100644 --- a/case_utils/ontology/src/ontology_and_version_iris.py +++ b/case_utils/ontology/src/ontology_and_version_iris.py @@ -28,7 +28,8 @@ def concept_is_cdo_concept(n_concept: rdflib.URIRef) -> bool: """ - This function is purposefully distinct from the function used in case_validate. Within this script, the publishing history of CASE and UCO is reviewed.""" + This function is purposefully distinct from the function used in case_validate. Within this script, the publishing history of CASE and UCO is reviewed. + """ concept_iri = str(n_concept) return ( concept_iri.startswith("https://ontology.unifiedcyberontology.org/") diff --git a/tests/case_utils/case_sparql_select/test_data_frame_to_table_text_json.py b/tests/case_utils/case_sparql_select/test_data_frame_to_table_text_json.py index 9e5cc24..8fc160d 100644 --- a/tests/case_utils/case_sparql_select/test_data_frame_to_table_text_json.py +++ b/tests/case_utils/case_sparql_select/test_data_frame_to_table_text_json.py @@ -36,9 +36,9 @@ ) -def make_data_frame_to_json_table_text_parameters() -> typing.Iterator[ - typing.Tuple[str, str, bool, bool] -]: +def make_data_frame_to_json_table_text_parameters() -> ( + typing.Iterator[typing.Tuple[str, str, bool, bool]] +): for use_header in [False, True]: for use_index in [False, True]: for output_mode in ["csv", "html", "json", "md", "tsv"]: From 94286ab8c4900e2ff24869885cc457fb30e3732b Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 14:10:44 -0500 Subject: [PATCH 20/28] Set pandas ceiling for 0.9.x releases This patch isolates a change needed to get patch-releases atop 0.9.0 to pass `make check`. This patch alone will not pass `make check`; see the following octopus merge for a commit that passes `make check`. Signed-off-by: Alex Nelson --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index fa9b6e5..80c6c98 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ license_files = [options] include_package_data = true install_requires = - pandas + pandas < 2.1.0 pyshacl rdflib >= 6.2.0 requests From 4c475fd75175af9b4d4881ece4bc40acbb401de0 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 14:13:39 -0500 Subject: [PATCH 21/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index 2af6aa1..9b97804 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.9.0" +__version__ = "0.9.1" from . import local_uuid # noqa: F401 From 2f580a2b80a08ec0dc66eb734b8f6ac72370ef3c Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 14:42:25 -0500 Subject: [PATCH 22/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index 9d281a0..1a62414 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.10.0" +__version__ = "0.10.1" from . import local_uuid # noqa: F401 From 800b8b16cdea13fb4eb8b9490107e6d90086074e Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 14:42:51 -0500 Subject: [PATCH 23/28] Lift rdflib ceiling for 0.10.x releases No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2c4603c..6041def 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ include_package_data = true install_requires = pandas < 2.1.0 pyshacl - rdflib >= 6.2.0, < 6.3.0 + rdflib >= 6.2.0 requests tabulate packages = find: From 13674d46c31aea0d13dd3319f113bedb5696dfd7 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 14:54:54 -0500 Subject: [PATCH 24/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index a9456fb..a4786a5 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -11,6 +11,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.11.0" +__version__ = "0.11.1" from . import local_uuid # noqa: F401 From 4b7f6a48893dee7e8c119f91cae43fd14e4450fb Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 14:57:13 -0500 Subject: [PATCH 25/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index c98638f..2501c85 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -14,6 +14,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.12.0" +__version__ = "0.12.1" from . import local_uuid # noqa: F401 From 536e2cdd7ef1688274acd9e1c26bc056a8e61811 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 15:09:59 -0500 Subject: [PATCH 26/28] Lift rdflib ceiling for 0.12.x releases No effects were observed on Make-managed files. Signed-off-by: Alex Nelson --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2644718..a947e24 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ include_package_data = true install_requires = pandas < 2.1.0 pyshacl - rdflib >= 6.2.0, < 7.0.0 + rdflib >= 6.2.0 requests tabulate packages = find: From a0e74e23b0d836d0dd6439dda0bc4376ae9322af Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 15:15:38 -0500 Subject: [PATCH 27/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index ee0b8df..36d8318 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -14,6 +14,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.13.0" +__version__ = "0.13.1" from . import local_uuid # noqa: F401 From 0ae98b4922e1706a3302939a3a7af55b4a86f275 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 22 Dec 2023 15:31:17 -0500 Subject: [PATCH 28/28] Bump version Signed-off-by: Alex Nelson --- case_utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/case_utils/__init__.py b/case_utils/__init__.py index 1421b3e..27a73ff 100644 --- a/case_utils/__init__.py +++ b/case_utils/__init__.py @@ -14,6 +14,6 @@ # # We would appreciate acknowledgement if the software is used. -__version__ = "0.14.0" +__version__ = "0.14.1" from . import local_uuid # noqa: F401