File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Benchmark
2+
3+ on :
4+ pull_request :
5+ branches : ["main"]
6+
7+ jobs :
8+ benchmark :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v6
12+ with :
13+ submodules : true
14+ - uses : astral-sh/setup-uv@v8.1.0
15+ - run : uv sync --frozen --all-extras
16+ - name : Run benchmarks
17+ id : run-benchmarks
18+ run : |
19+ uv run python scripts/benchmark.py --branch ${{ github.sha }}
20+ - uses : actions/upload-artifact@v7
21+ with :
22+ name : benchmark-${{ matrix.target.name }}
23+ path : ${{ steps.run-benchmarks.outputs.report_file }}
24+
25+ # report:
26+ # needs: [benchmark]
27+ # runs-on: ubuntu-latest
28+ # steps:
29+ # - uses: actions/checkout@v6
30+ # - uses: astral-sh/setup-uv@v8.1.0
31+ # - run: uv sync --group "benchmark"
32+ # - uses: actions/download-artifact@v8
33+ # with:
34+ # pattern: benchmark-*
35+ # - name: Generate report
36+ # run: |
37+ # uv run .github/scripts/compare_benchmarks.py \
38+ # --output benchmarks.md \
39+ # --pattern benchmark-*.json
Original file line number Diff line number Diff 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 \
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ htmlcov
2626
2727# Local data and scratch
2828.scratch
29+ benchmarks /
2930
3031# Local virtual environment
3132.venv
Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ pybids = ["pandas>=2.0.0"]
3737[dependency-groups ]
3838dev = [
3939 " pdoc>=16.0.0" ,
40+ " polars>=1.40.1" ,
4041 " pre-commit>=4.6.0" ,
4142 " pytest>=9.0.3" ,
43+ " pytest-benchmark>=5.2.3" ,
4244 " pytest-cov>=7.1.0" ,
4345 " ruff>=0.15.13" ,
4446]
@@ -68,4 +70,8 @@ lint.extend-select = ["I"]
6870[tool .pytest .ini_options ]
6971log_cli = true
7072log_cli_level = " INFO"
71- markers = [" cloud: Tests requiring cloud group dependencies" ]
73+ addopts = " --import-mode=importlib"
74+ markers = [
75+ " benchmark: Tests used for benchmarking" ,
76+ " cloud: Tests requiring cloud group dependencies" ,
77+ ]
You can’t perform that action at this time.
0 commit comments