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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ jobs:
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Run tests

- name: Run tests without cloudpathlib
run: |
uv run pytest tests
- name: Run tests with cloudpathlib
run: |
uv run --all-extras pytest \
--junitxml=pytest.xml \
Expand Down
5 changes: 2 additions & 3 deletions bids2table/_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from typing import Any, Callable, Generator, Iterable, Sequence

import pyarrow as pa
from cloudpathlib import CloudPath
from tqdm import tqdm

from ._entities import (
Expand All @@ -24,7 +23,7 @@
validate_bids_entities,
)
from ._logging import setup_logger
from ._pathlib import PathT, as_path
from ._pathlib import CloudPath, PathT, as_path, cloudpathlib_is_available

_BIDS_SUBJECT_DIR_PATTERN = re.compile(r"sub-[a-zA-Z0-9]+")

Expand Down Expand Up @@ -404,7 +403,7 @@ def _index_bids_subject_dir(

records = []
# Use built-in rglob methods for CloudPath and py3.13+
if isinstance(path, CloudPath):
if cloudpathlib_is_available() and isinstance(path, CloudPath):
paths = map(as_path, path.rglob("sub-*"))
elif sys.version_info >= (3, 13):
paths = map(as_path, path.rglob("sub-*", recurse_symlinks=True))
Expand Down
3 changes: 3 additions & 0 deletions tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def test_find_bids_datasets():
assert datasets_no_derivatives == expected_datasets_no_derivatives


@pytest.mark.skipif(
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
)
def test_find_bids_datasets_s3():
root = "s3://openneuro.org"
datasets = list(islice(indexing.find_bids_datasets(root, maxdepth=2), 10))
Expand Down
Loading