Skip to content

Commit 4b29263

Browse files
authored
Separate pytest-benchmark into dedicated benchmark dependency group (#2937)
1 parent da32bb7 commit 4b29263

4 files changed

Lines changed: 20 additions & 18 deletions

File tree

.github/workflows/codspeed.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install the latest version of uv
2727
uses: astral-sh/setup-uv@v5
2828
- name: Install dependencies
29-
run: uv sync --all-extras
29+
run: uv sync --all-extras --group benchmark
3030
- name: Run benchmarks
3131
uses: CodSpeedHQ/action@v4
3232
with:

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ test = [
8585
"msgspec>=0.18",
8686
"pytest>=6.1",
8787
"pytest>=8.3.4",
88-
"pytest-benchmark",
89-
"pytest-codspeed>=2.2",
9088
"pytest-cov>=2.12.1",
9189
"pytest-cov>=5",
9290
"pytest-mock>=3.14",
@@ -106,6 +104,10 @@ type = [
106104
docs = [
107105
"zensical>=0.0.15; python_version>='3.10'",
108106
]
107+
benchmark = [
108+
"pytest-benchmark",
109+
"pytest-codspeed>=2.2",
110+
]
109111
black22 = [ "black==22.1" ]
110112
black23 = [ "black==23.12" ]
111113
black24 = [ "black==24.1" ]
@@ -230,7 +232,10 @@ filterwarnings = [
230232
]
231233
norecursedirs = [ "tests/data/*", ".tox" ]
232234
verbosity_assertions = 2
233-
markers = [ "perf: marks tests as performance tests (excluded from CI benchmarks)" ]
235+
markers = [
236+
"perf: marks tests as performance tests (excluded from CI benchmarks)",
237+
"benchmark: marks tests as benchmark tests",
238+
]
234239

235240
[tool.coverage]
236241
html.skip_covered = false

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ commands =
3838
parallel: -n auto \
3939
--color=yes \
4040
-m "not perf" \
41-
-p no:codspeed --benchmark-disable \
4241
--cov {env_site_packages_dir}{/}datamodel_code_generator --cov {tox_root}{/}tests \
4342
--cov-config=pyproject.toml --cov-fail-under=0 --no-cov-on-fail --cov-report term-missing:skip-covered \
4443
--cov-report html:{env_tmp_dir}{/}htmlcov \
@@ -169,5 +168,7 @@ commands =
169168
--color=yes \
170169
--codspeed \
171170
tests/main/test_performance.py}
172-
dependency_groups = test
171+
dependency_groups =
172+
test
173+
benchmark
173174
platform = linux|darwin

uv.lock

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

0 commit comments

Comments
 (0)