Skip to content

Commit b4e91a8

Browse files
authored
Merge pull request #149 from casework/release-0.6.1
2 parents 5073694 + ea54c7a commit b4e91a8

File tree

9 files changed

+44
-22
lines changed

9 files changed

+44
-22
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: |

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 22.3.0
3+
rev: 23.12.0
44
hooks:
55
- id: black
66
- repo: https://github.com/pycqa/flake8
7-
rev: 4.0.1
7+
rev: 6.1.0
88
hooks:
99
- id: flake8
1010
- repo: https://github.com/pycqa/isort
11-
rev: 5.10.1
11+
rev: 5.13.2
1212
hooks:
1313
- id: isort
1414
name: isort (python)

case_utils/__init__.py

Lines changed: 1 addition & 1 deletion
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.6.0"
14+
__version__ = "0.6.1"
1515

1616
from . import local_uuid # noqa: F401

case_utils/case_file/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

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

42+
4243
# Shortcut syntax for defining an immutable named tuple is noted here:
4344
# https://docs.python.org/3/library/typing.html#typing.NamedTuple
4445
# via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple

case_utils/case_sparql_construct/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def main() -> None:
9898
construct_query_result = in_graph.query(construct_query_object)
9999
_logger.debug("type(construct_query_result) = %r." % type(construct_query_result))
100100
_logger.debug("len(construct_query_result) = %d." % len(construct_query_result))
101-
for (row_no, row) in enumerate(construct_query_result):
101+
for row_no, row in enumerate(construct_query_result):
102102
if row_no == 0:
103103
_logger.debug("row[0] = %r." % (row,))
104104
out_graph.add(row)

case_utils/case_sparql_select/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def main() -> None:
110110
select_query_object = rdflib.plugins.sparql.prepareQuery(
111111
select_query_text, initNs=nsdict
112112
)
113-
for (row_no, row) in enumerate(graph.query(select_query_object)):
113+
for row_no, row in enumerate(graph.query(select_query_object)):
114114
tally = row_no + 1
115115
record = []
116-
for (column_no, column) in enumerate(row):
116+
for column_no, column in enumerate(row):
117117
if column is None:
118118
column_value = ""
119119
elif (

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/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

0 commit comments

Comments
 (0)