Skip to content

Commit 4afac6d

Browse files
committed
Fix CI workflow bugs
- Mark tests with "cloud" and / or "benchmark" as needed - Combine both "dev" and "benchmark" dependencies, was causing issues with the pytest due to imports (alternatively, use `try-except` block for optional dependency import) - Replace pandas with polars in dev dependency (for benchmarking)
1 parent 93f1914 commit 4afac6d

6 files changed

Lines changed: 14 additions & 22 deletions

File tree

.github/scripts/run_benchmarks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def main():
1414
pytest.main(
1515
[
1616
"-m",
17-
"benchmark",
17+
"benchmark and not cloud",
1818
"--benchmark-save-data",
1919
f"--benchmark-json={args.output}",
2020
"--benchmark-time-unit=ms",

.github/workflows/benchmark.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
ref: ${{ matrix.target.ref }}
3636
submodules: true
3737
- uses: astral-sh/setup-uv@v8.1.0
38-
- run: uv sync --group "benchmark" --extra "cloud"
38+
- run: uv sync --extra "cloud"
3939
- name: Run benchmarks
4040
run: |
4141
uv run .github/scripts/run_benchmarks.py \
@@ -51,7 +51,6 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@v6
5353
- uses: astral-sh/setup-uv@v8.1.0
54-
- run: uv sync --group "benchmark"
5554
- uses: actions/download-artifact@v8
5655
with:
5756
pattern: benchmark-*

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ jobs:
4242
python-version: ${{ matrix.python-version }}
4343
- run: uv sync --all-extras
4444

45-
- name: Run tests without cloudpathlib
45+
- name: Run non-cloud tests
4646
run: |
4747
uv run pytest \
48-
-m "not cloud" \
48+
-m "not cloud and not benchmark" \
4949
--junitxml=pytest-cloudless.xml \
5050
--cov-report=xml:coverage.xml \
51-
--cov bids2table \
51+
--cov=bids2table \
5252
tests
5353
54-
- name: Run tests with cloudpathlib
54+
- name: Run cloud tests
5555
run: |
5656
uv run pytest \
57-
-m "cloud" \
57+
-m "cloud and not benchmark" \
5858
--junitxml=pytest-cloud.xml \
5959
--cov-report=xml:coverage.xml \
6060
--cov=bids2table \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ s3 = [
3535
pybids = ["pandas>=2.0.0"]
3636

3737
[dependency-groups]
38-
benchmark = ["polars>=1.40.1", "pytest>=9.0.3", "pytest-benchmark>=5.2.3"]
3938
dev = [
4039
"pdoc>=16.0.0",
4140
"pre-commit>=4.6.0",
4241
"pytest>=9.0.3",
42+
"pytest-benchmark>=5.2.3",
4343
"pytest-cov>=7.1.0",
4444
"ruff>=0.15.13",
4545
]

tests/benchmarks/test_index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def _teardown(index_fpath: Path):
6767

6868

6969
@pytest.mark.benchmark
70+
@pytest.mark.cloud
7071
def test_openneuro(benchmark: BenchmarkFixture, tmp_path: Path) -> None:
7172
"""Benchmark b2t2 with a subset of datasets on OpenNeuro."""
7273
workers = 4

uv.lock

Lines changed: 5 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)