Separate pytest-benchmark into dedicated benchmark dependency group#2937
Separate pytest-benchmark into dedicated benchmark dependency group#2937
Conversation
📝 WalkthroughWalkthroughThe pull request reorganizes benchmark-related dependencies into a dedicated dependency group, separating them from test dependencies. The CI/CD workflow, project manifest, and test configuration are updated to recognize and utilize this new benchmark dependency group. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CodSpeed Performance ReportMerging #2937 will improve performance by 22.28%Comparing
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | test_perf_multiple_files_input |
3.8 s | 3.1 s | +22.28% |
| ⚡ | WallTime | test_perf_all_options_enabled |
6.7 s | 5.7 s | +17.54% |
| ⚡ | WallTime | test_perf_aws_style_openapi_pydantic_v2 |
2 s | 1.7 s | +18.96% |
| ⚡ | WallTime | test_perf_openapi_large |
2.9 s | 2.5 s | +18.19% |
| ⚡ | WallTime | test_perf_stripe_style_pydantic_v2 |
2 s | 1.7 s | +17.49% |
| ⚡ | WallTime | test_perf_kubernetes_style_pydantic_v2 |
2.6 s | 2.2 s | +17.19% |
| ⚡ | WallTime | test_perf_complex_refs |
2 s | 1.7 s | +18.26% |
| ⚡ | WallTime | test_perf_graphql_style_pydantic_v2 |
807 ms | 696.9 ms | +15.79% |
| ⚡ | WallTime | test_perf_duplicate_names |
987.9 ms | 841.8 ms | +17.36% |
| ⚡ | WallTime | test_perf_deep_nested |
6 s | 5 s | +18.23% |
| ⚡ | WallTime | test_perf_large_models_pydantic_v2 |
3.6 s | 3.1 s | +18.01% |
Footnotes
-
98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2937 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 92 92
Lines 16969 16969
Branches 1976 1976
=========================================
Hits 16969 16969
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pyproject.toml (1)
235-238: Consider clarifying the marker distinction.The marker descriptions distinguish between "perf" (excluded from CI benchmarks) and "benchmark" (for benchmark tests), which is good. However, the "perf" description could be slightly clearer—consider rephrasing to "marks tests as performance tests (not tracked as benchmarks in CI)" to emphasize that they run but aren't tracked for regression.
🔎 Suggested clarification
markers = [ - "perf: marks tests as performance tests (excluded from CI benchmarks)", + "perf: marks tests as performance tests (not tracked as benchmarks in CI)", "benchmark: marks tests as benchmark tests", ]
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock,!**/*.lockand included by none
📒 Files selected for processing (3)
.github/workflows/codspeed.yamlpyproject.tomltox.ini
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Analyze (python)
- GitHub Check: 3.11 on Windows
- GitHub Check: 3.10 on macOS
- GitHub Check: 3.11 on macOS
- GitHub Check: 3.13 on Windows
- GitHub Check: 3.12 on Windows
- GitHub Check: 3.10 on Windows
- GitHub Check: 3.14 on macOS
- GitHub Check: 3.14 on Windows
- GitHub Check: benchmarks
🔇 Additional comments (3)
.github/workflows/codspeed.yaml (1)
29-29: LGTM! Correctly installs the new benchmark dependency group.The addition of
--group benchmarkproperly aligns with the new dependency group structure inpyproject.toml, ensuring benchmark-specific packages are available for the CodSpeed workflow.tox.ini (1)
171-173: LGTM! Correctly includes both test and benchmark groups for performance testing.The perf environment appropriately includes both the
testandbenchmarkdependency groups, ensuring all necessary dependencies are available. The multi-line format also improves readability.pyproject.toml (1)
107-110: Benchmark dependency group is properly isolated with compatible version constraint.The benchmark group cleanly separates benchmark tooling from test dependencies. Verification confirms that no unintended benchmark imports exist in non-perf tests or source code, and the
>=2.2version constraint for pytest-codspeed is compatible with current releases.
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR reorganizes internal development dependencies by moving pytest-benchmark and pytest-codspeed from the 'test' dependency group to a new dedicated 'benchmark' dependency group. These changes only affect development and CI infrastructure. End users of datamodel-code-generator (either as a CLI tool or Python library) are not impacted since they don't install dev dependencies. The code generation output, CLI options, Python API, default behaviors, error handling, and Python version support remain unchanged. This analysis was performed by Claude Code Action |
|
🎉 Released in 0.53.0 This PR is now available in the latest release. See the release notes for details. |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.