Skip to content

Commit

Permalink
Merge branch 'release-0.11.1' into support-0.11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnelson-nist committed Dec 22, 2023
2 parents 435d67e + a061c88 commit f044e41
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ name: Continuous Integration

on:
push:
branches:
branches:
- main
- develop
- support-*
pull_request:
branches:
branches:
- main
- develop
- support-*
release:
types:
- published
Expand All @@ -32,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
python-version:
- '3.8'
- '3.11'

Expand All @@ -54,7 +56,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: |
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.12.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
29 changes: 25 additions & 4 deletions case_utils/local_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,28 @@
_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:
"""
This function is part of setting up demo_uuid() to generate non-random UUIDs. See demo_uuid() documentation for further setup notes.
"""
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.",
Expand Down Expand Up @@ -87,18 +103,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.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ license_files =
[options]
include_package_data = true
install_requires =
pandas
pandas < 2.1.0
pyshacl
rdflib >= 6.2.0
requests
Expand Down
4 changes: 1 addition & 3 deletions tests/case_utils/case_validate/uco_test_examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ SHELL := /bin/bash

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

case_srcdir := $(top_srcdir)/dependencies/CASE

uco_srcdir := $(case_srcdir)/dependencies/UCO
uco_srcdir := $(top_srcdir)/dependencies/CASE/dependencies/UCO

examples_srcdir := $(uco_srcdir)/tests/examples

Expand Down

0 comments on commit f044e41

Please sign in to comment.