Skip to content

Commit fca7388

Browse files
committed
Merge branches 'HotFix-0.6.1-refresh_pre_commit' and 'support-0.5.x' into release-0.6.1
2 parents 63de50e + 0cc08cb commit fca7388

File tree

9 files changed

+86
-18
lines changed

9 files changed

+86
-18
lines changed

.github/workflows/cicd.yml

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

1414
on:
1515
push:
16-
branches:
16+
branches:
1717
- main
1818
- develop
19+
- support-*
1920
pull_request:
20-
branches:
21+
branches:
2122
- main
2223
- develop
24+
- support-*
2325
release:
2426
types:
2527
- published
@@ -30,8 +32,8 @@ jobs:
3032
runs-on: ubuntu-latest
3133
strategy:
3234
matrix:
33-
python-version:
34-
- '3.7'
35+
python-version:
36+
- '3.8'
3537
- '3.10'
3638

3739
steps:
@@ -52,7 +54,7 @@ jobs:
5254
run: make clean
5355
- name: Run tests
5456
run: make PYTHON3=python check
55-
57+
5658
# Build the binary wheel as well as the source tar
5759
- name: Build Objects
5860
run: |

case_utils/local_uuid.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
This library is a wrapper for uuid, provided to generate repeatable UUIDs if requested.
1616
"""
1717

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

2020
import logging
2121
import os
@@ -32,9 +32,25 @@
3232
_logger = logging.getLogger(pathlib.Path(__file__).name)
3333

3434

35+
def _is_relative_to(p1: pathlib.Path, p2: pathlib.Path) -> bool:
36+
"""
37+
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.
38+
"""
39+
if sys.version_info < (3, 9):
40+
try:
41+
_ = p1.relative_to(p2)
42+
return True
43+
except ValueError:
44+
return False
45+
else:
46+
return p1.is_relative_to(p2)
47+
48+
3549
def configure() -> None:
3650
global DEMO_UUID_BASE
3751

52+
# _logger.debug("sys.argv = %r.", sys.argv)
53+
3854
if os.getenv("DEMO_UUID_REQUESTING_NONRANDOM") == "NONRANDOM_REQUESTED":
3955
warnings.warn(
4056
"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:
8298
demo_uuid_base_parts.append(sys.argv[0])
8399
else:
84100
command_original_path = pathlib.Path(sys.argv[0])
101+
# _logger.debug("command_original_path = %r.", command_original_path)
85102
command_resolved_path = command_original_path.resolve()
103+
# _logger.debug("command_resolved_path = %r.", command_resolved_path)
104+
105+
# The command could be a command embedded in a virtual
106+
# environment, or it could be a script external to any virtual
107+
# environment.
86108
venv_original_path = pathlib.Path(env_venv_name)
87109
venv_resolved_path = venv_original_path.resolve()
88-
try:
110+
if _is_relative_to(command_resolved_path, venv_resolved_path):
89111
command_relative_path = command_resolved_path.relative_to(
90112
venv_resolved_path
91113
)
92114
# _logger.debug("command_relative_path = %r.", command_relative_path)
93115
demo_uuid_base_parts.append(str(command_relative_path))
94-
except ValueError:
95-
# _logger.debug("Command path is not relative to virtual environment path.")
96-
demo_uuid_base_parts.append(str(command_resolved_path))
116+
else:
117+
demo_uuid_base_parts.append(str(command_original_path))
97118

98119
if len(sys.argv) > 1:
99120
# Component: Arguments of argument vector.

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ include_package_data = true
2121
install_requires =
2222
pandas
2323
pyshacl
24-
rdflib >= 6.0.2
24+
rdflib >= 6.0.2, < 6.3.0
2525
requests
2626
tabulate
2727
packages = find:
28-
python_requires = >=3.7
28+
python_requires = >=3.8
2929

3030
[options.entry_points]
3131
console_scripts =

tests/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ all: \
2222

2323
.PHONY: \
2424
all-case_utils \
25+
all-lib \
2526
check-case_utils \
2627
check-isomorphic_diff \
2728
check-mypy \
@@ -53,10 +54,15 @@ all: \
5354
touch $@
5455

5556
all-case_utils: \
56-
.venv.done.log
57+
.venv.done.log \
58+
all-lib
5759
$(MAKE) \
5860
--directory case_utils
5961

62+
all-lib:
63+
$(MAKE) \
64+
--directory lib
65+
6066
# These check calls are provided in preferred run-order.
6167
check: \
6268
check-mypy \
@@ -68,7 +74,8 @@ check: \
6874
--log-level=DEBUG
6975

7076
check-case_utils: \
71-
.venv.done.log
77+
.venv.done.log \
78+
all-lib
7279
$(MAKE) \
7380
--directory case_utils \
7481
check

tests/case_utils/case_validate/cli/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ examples_srcdir := $(case_srcdir)/tests/examples
2121

2222
tests_srcdir := $(top_srcdir)/tests
2323

24-
RDF_TOOLKIT_JAR := $(case_srcdir)/lib/rdf-toolkit.jar
24+
RDF_TOOLKIT_JAR := $(tests_srcdir)/lib/rdf-toolkit.jar
2525

2626
files_to_generate := \
2727
format_human_output_jsonld.jsonld \

tests/case_utils/case_validate/uco_test_examples/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ SHELL := /bin/bash
1515

1616
top_srcdir := $(shell cd ../../../.. ; pwd)
1717

18-
case_srcdir := $(top_srcdir)/dependencies/CASE
19-
20-
uco_srcdir := $(case_srcdir)/dependencies/UCO
18+
uco_srcdir := $(top_srcdir)/dependencies/CASE/dependencies/UCO
2119

2220
examples_srcdir := $(uco_srcdir)/tests/examples
2321

tests/lib/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.jar

tests/lib/Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/make -f
2+
3+
# Portions of this file contributed by NIST are governed by the
4+
# following statement:
5+
#
6+
# This software was developed at the National Institute of Standards
7+
# and Technology by employees of the Federal Government in the course
8+
# of their official duties. Pursuant to Title 17 Section 105 of the
9+
# United States Code, this software is not subject to copyright
10+
# protection within the United States. NIST assumes no responsibility
11+
# whatsoever for its use by other parties, and makes no guarantees,
12+
# expressed or implied, about its quality, reliability, or any other
13+
# characteristic.
14+
#
15+
# We would appreciate acknowledgement if the software is used.
16+
17+
# This Makefile is incorporated to support versions of case-utils since
18+
# 0.5.0 that had not yet incorporated rdf-toolkit-1.11.0.jar into their
19+
# testing process. The Makefile is adapted from the `/lib` directory of
20+
# UCO at version 1.2.0.
21+
22+
SHELL := /bin/bash
23+
24+
all: \
25+
rdf-toolkit.jar
26+
27+
rdf-toolkit.jar:
28+
test -r rdf-toolkit.jar.sha512
29+
rm -f $@_
30+
# Try retrieval from files.caseontology.org.
31+
wget \
32+
--output-document $@_ \
33+
https://files.caseontology.org/rdf-toolkit-1.11.0.jar
34+
test \
35+
"x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \
36+
== \
37+
"x$$(head -n1 rdf-toolkit.jar.sha512)"
38+
mv $@_ $@

tests/lib/rdf-toolkit.jar.sha512

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8131e5515da63f099a89a3ce2c7587fb6b228f1ec7c5eb49ff35710509e8511921bfc847e182ee994e575b1f7895c04ae5bed7e1b7826bb32c9475b43b74dc17

0 commit comments

Comments
 (0)