Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/remote_package_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10","3.12"]
python-version: ["3.10","3.12","3.13"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intent with skipping 3.11 was to test lower & highest supported version. should we continue that pattern?

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
python-version: ["3.10","3.12"]
python-version: ["3.10","3.12","3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.10","3.12"]
python-version: ["3.10","3.12","3.13"]
steps:
- uses: actions/checkout@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions garak/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def _eval_paths(self, segment, next_call, relative):
if projected.exists():
return LocalDataPath(projected)

if projected in self.ORDERED_SEARCH_PATHS:
return LocalDataPath(projected)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


raise GarakException(f"The resource requested does not exist {segment}")

def _glob(self, pattern, recursive=False):
Expand Down Expand Up @@ -96,5 +99,16 @@ def joinpath(self, *pathsegments):
projected = self._eval_paths(segment, "joinpath", "..")
return projected

import sys

if sys.version_info >= (3, 13, 0):
# disabled override on older versions
def with_segments(self, *args):
if isinstance(args[0], LocalDataPath):
for segment in args:
projected = self._eval_paths(segment, "joinpath", "..")
return projected
return super().with_segments(*args)


path = LocalDataPath(_config.transient.data_dir / "data")