Skip to content

Update pre-commit hooks and CI tool versions#2376

Merged
adenzler-nvidia merged 5 commits intonewton-physics:mainfrom
shi-eric:ershi/pre-commit-ci-update
Apr 9, 2026
Merged

Update pre-commit hooks and CI tool versions#2376
adenzler-nvidia merged 5 commits intonewton-physics:mainfrom
shi-eric:ershi/pre-commit-ci-update

Conversation

@shi-eric
Copy link
Copy Markdown
Member

@shi-eric shi-eric commented Apr 8, 2026

Description

Update pre-commit hooks and CI tool versions:

  • Bump ruff from v0.11.2 to v0.15.9 in pre-commit and from 0.11.2 to 0.15.9 in CI workflows
  • Bump uv from 0.6.x to 0.11.4 across CI workflows
  • Bump typos from v1.42.0 to v1.45.0
  • Apply ruff formatting fixes (parenthesized multi-line lambdas, rsplit for last-component extraction)
  • Add iz to typos allow-list to suppress new false positive

Checklist

  • New or existing tests cover these changes
  • The documentation is up to date with these changes
  • CHANGELOG.md has been updated (if user-facing change)

Test plan

uvx pre-commit run -a

Verify CI passes with updated tool versions.

Summary by CodeRabbit

  • Chores

    • Updated developer tooling versions across CI and pre-commit (uv, ruff, typos).
    • Added a whitelist entry to the typo-check configuration.
  • Refactor

    • Minor formatting and expression cleanups across examples, utilities, and tests to improve consistency and lint compliance.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 83a9e0ee-80e3-4575-aa6d-ed9928118e1f

📥 Commits

Reviewing files that changed from the base of the PR and between 06fac86 and 1cd2373.

📒 Files selected for processing (32)
  • .github/workflows/aws_gpu_benchmarks.yml
  • .github/workflows/aws_gpu_tests.yml
  • .github/workflows/ci.yml
  • .github/workflows/docs-dev.yml
  • .github/workflows/docs-release.yml
  • .github/workflows/minimum_deps_tests.yml
  • .github/workflows/mujoco_warp_tests.yml
  • .github/workflows/pr.yml
  • .github/workflows/release.yml
  • .github/workflows/scheduled_nightly.yml
  • .github/workflows/warp_nightly_tests.yml
  • .pre-commit-config.yaml
  • asv/benchmarks/benchmark_mujoco.py
  • docs/print_api.py
  • newton/_src/sim/graph_coloring.py
  • newton/_src/solvers/kamino/examples/newton/example_anymal_d.py
  • newton/_src/solvers/kamino/examples/newton/example_dr_legs.py
  • newton/_src/solvers/kamino/tests/test_solver_kamino.py
  • newton/_src/usd/utils.py
  • newton/_src/utils/selection.py
  • newton/examples/basic/example_basic_joints.py
  • newton/examples/basic/example_basic_shapes.py
  • newton/examples/robot/example_robot_anymal_d.py
  • newton/examples/robot/example_robot_cartpole.py
  • newton/examples/robot/example_robot_g1.py
  • newton/examples/selection/example_selection_cartpole.py
  • newton/tests/test_body_force.py
  • newton/tests/test_kinematic_links.py
  • newton/tests/test_rigid_contact.py
  • newton/tests/test_robot_composer.py
  • newton/tests/test_runtime_gravity.py
  • pyproject.toml
✅ Files skipped from review due to trivial changes (28)
  • .github/workflows/release.yml
  • .github/workflows/mujoco_warp_tests.yml
  • .github/workflows/ci.yml
  • .github/workflows/pr.yml
  • .github/workflows/aws_gpu_benchmarks.yml
  • .github/workflows/aws_gpu_tests.yml
  • .github/workflows/warp_nightly_tests.yml
  • newton/_src/sim/graph_coloring.py
  • .github/workflows/docs-dev.yml
  • newton/examples/robot/example_robot_g1.py
  • newton/examples/basic/example_basic_shapes.py
  • newton/_src/solvers/kamino/examples/newton/example_dr_legs.py
  • newton/examples/robot/example_robot_anymal_d.py
  • .github/workflows/minimum_deps_tests.yml
  • newton/examples/selection/example_selection_cartpole.py
  • .github/workflows/docs-release.yml
  • newton/_src/solvers/kamino/examples/newton/example_anymal_d.py
  • newton/tests/test_robot_composer.py
  • newton/examples/robot/example_robot_cartpole.py
  • pyproject.toml
  • docs/print_api.py
  • newton/_src/utils/selection.py
  • newton/tests/test_body_force.py
  • .pre-commit-config.yaml
  • newton/examples/basic/example_basic_joints.py
  • .github/workflows/scheduled_nightly.yml
  • newton/_src/usd/utils.py
  • asv/benchmarks/benchmark_mujoco.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • newton/_src/solvers/kamino/tests/test_solver_kamino.py
  • newton/tests/test_runtime_gravity.py

📝 Walkthrough

Walkthrough

Bumps pinned uv tool version(s), updates pre-commit revs and a typos whitelist entry, applies minor formatting and small refactors across tests/examples/utilities, and replaces some test lambda wrappers with direct callables. No public API signatures or runtime behavior changes.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows — uv version bump
.github/workflows/aws_gpu_benchmarks.yml, .github/workflows/aws_gpu_tests.yml, .github/workflows/ci.yml, .github/workflows/docs-dev.yml, .github/workflows/docs-release.yml, .github/workflows/minimum_deps_tests.yml, .github/workflows/mujoco_warp_tests.yml, .github/workflows/pr.yml, .github/workflows/release.yml, .github/workflows/scheduled_nightly.yml, .github/workflows/warp_nightly_tests.yml
Updated astral-sh/setup-uv version input from 0.11.00.11.4. No other workflow logic changed.
Pre-commit & typo config
.pre-commit-config.yaml, pyproject.toml
Bumped pre-commit revs (ruff-pre-commit, uv-pre-commit, typos) and added iz to typos whitelist. Other hook fields unchanged.
Formatting / multi-line predicates
newton/examples/.../example_robot_cartpole.py, newton/examples/.../example_robot_anymal_d.py, newton/examples/.../example_robot_g1.py, newton/examples/basic/example_basic_shapes.py, newton/examples/basic/example_basic_joints.py, newton/examples/selection/example_selection_cartpole.py, newton/_src/solvers/kamino/examples/newton/example_anymal_d.py, newton/_src/solvers/kamino/examples/newton/example_dr_legs.py
Added # fmt: off/# fmt: on, parenthesized or reformatted multi-line lambda predicates and assertions; predicates and thresholds unchanged.
Test callable / solver factory refactors
newton/tests/test_body_force.py, newton/tests/test_kinematic_links.py, newton/tests/test_rigid_contact.py, newton/tests/test_robot_composer.py, newton/tests/test_runtime_gravity.py, newton/_src/solvers/kamino/tests/test_solver_kamino.py
Replaced lambda wrappers with direct class/constructor/method callables (e.g., lambda model: SolverX(model)SolverX, lambda: C()C). Test-local only; semantics preserved.
Misc small refactors & API printing
docs/print_api.py, newton/_src/utils/selection.py, newton/_src/usd/utils.py, newton/_src/sim/graph_coloring.py, asv/benchmarks/benchmark_mujoco.py
Minor simplifications: use rsplit(...,1)[-1], simplify ternary/lambda expressions, use key=len, add # noqa comments. No behavioral changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • adenzler-nvidia
  • Kenny-Vilella
  • eric-heiden
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: updating pre-commit hooks and CI tool versions (ruff, uv, typos) across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.pre-commit-config.yaml (1)

20-34: Consider documenting tool updates in CHANGELOG if they result in code changes.

The PR applies ruff-driven formatting fixes to the codebase. While tool version updates are typically internal changes, the resulting code formatting changes are visible to users and contributors.

As per coding guidelines, user-facing changes should include a CHANGELOG entry. If the formatting changes affect code that users interact with, consider adding an entry under the "Changed" category.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 20 - 34, Add a CHANGELOG "Changed"
entry noting the ruff-driven formatting and the tool/version updates shown in
.pre-commit-config.yaml (ruff rev v0.15.9 with ruff-format, uv-pre-commit rev
0.11.4 with uv-lock, and typos rev v1.45.0) so users/contributors see that
formatting changes were applied; include a brief line describing that code was
auto-formatted by ruff and list the updated hook versions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.pre-commit-config.yaml:
- Around line 20-34: Add a CHANGELOG "Changed" entry noting the ruff-driven
formatting and the tool/version updates shown in .pre-commit-config.yaml (ruff
rev v0.15.9 with ruff-format, uv-pre-commit rev 0.11.4 with uv-lock, and typos
rev v1.45.0) so users/contributors see that formatting changes were applied;
include a brief line describing that code was auto-formatted by ruff and list
the updated hook versions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d207212f-eda3-41c0-9526-a9f2002d9b31

📥 Commits

Reviewing files that changed from the base of the PR and between 280b67a and cba43ff.

📒 Files selected for processing (24)
  • .github/workflows/aws_gpu_benchmarks.yml
  • .github/workflows/aws_gpu_tests.yml
  • .github/workflows/ci.yml
  • .github/workflows/docs-dev.yml
  • .github/workflows/docs-release.yml
  • .github/workflows/minimum_deps_tests.yml
  • .github/workflows/mujoco_warp_tests.yml
  • .github/workflows/pr.yml
  • .github/workflows/release.yml
  • .github/workflows/scheduled_nightly.yml
  • .github/workflows/warp_nightly_tests.yml
  • .pre-commit-config.yaml
  • docs/print_api.py
  • newton/_src/solvers/kamino/examples/newton/example_anymal_d.py
  • newton/_src/solvers/kamino/examples/newton/example_dr_legs.py
  • newton/_src/usd/utils.py
  • newton/_src/utils/selection.py
  • newton/examples/basic/example_basic_joints.py
  • newton/examples/basic/example_basic_shapes.py
  • newton/examples/robot/example_robot_anymal_d.py
  • newton/examples/robot/example_robot_cartpole.py
  • newton/examples/robot/example_robot_g1.py
  • newton/examples/selection/example_selection_cartpole.py
  • pyproject.toml

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@asv/benchmarks/benchmark_mujoco.py`:
- Around line 85-90: ROBOT_CONFIGS currently stores direct references to
_setup_kitchen and _setup_tabletop which are evaluated at import time and cause
NameError; change the config entries so setup_builder is a zero-arg callable
that defers lookup (e.g. wrap the references in lambdas) so that when code
retrieves config["setup_builder"] and calls it later the functions are resolved
at call time; update the entries for "kitchen" and "tabletop" in ROBOT_CONFIGS
accordingly while keeping the rest of the dict unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 9c8f088a-187a-40d0-b35f-51ee648d870d

📥 Commits

Reviewing files that changed from the base of the PR and between cba43ff and 774e1e5.

📒 Files selected for processing (16)
  • asv/benchmarks/benchmark_mujoco.py
  • newton/_src/sim/graph_coloring.py
  • newton/_src/solvers/kamino/examples/newton/example_anymal_d.py
  • newton/_src/solvers/kamino/examples/newton/example_dr_legs.py
  • newton/_src/solvers/kamino/tests/test_solver_kamino.py
  • newton/examples/basic/example_basic_joints.py
  • newton/examples/basic/example_basic_shapes.py
  • newton/examples/robot/example_robot_anymal_d.py
  • newton/examples/robot/example_robot_cartpole.py
  • newton/examples/robot/example_robot_g1.py
  • newton/examples/selection/example_selection_cartpole.py
  • newton/tests/test_body_force.py
  • newton/tests/test_kinematic_links.py
  • newton/tests/test_rigid_contact.py
  • newton/tests/test_robot_composer.py
  • newton/tests/test_runtime_gravity.py
✅ Files skipped from review due to trivial changes (10)
  • newton/_src/sim/graph_coloring.py
  • newton/examples/basic/example_basic_shapes.py
  • newton/_src/solvers/kamino/examples/newton/example_anymal_d.py
  • newton/examples/robot/example_robot_anymal_d.py
  • newton/examples/selection/example_selection_cartpole.py
  • newton/examples/robot/example_robot_g1.py
  • newton/_src/solvers/kamino/tests/test_solver_kamino.py
  • newton/_src/solvers/kamino/examples/newton/example_dr_legs.py
  • newton/examples/robot/example_robot_cartpole.py
  • newton/examples/basic/example_basic_joints.py

Comment thread asv/benchmarks/benchmark_mujoco.py Outdated
@shi-eric shi-eric self-assigned this Apr 8, 2026
@shi-eric shi-eric added the automation Issues related to ci/cd and automation in general label Apr 8, 2026
shi-eric added 5 commits April 8, 2026 15:48
Bump crate-ci/typos from v1.42.0 to v1.45.0 and add "iz" to the
allowed words list in pyproject.toml to suppress a new false positive.
Bump ruff pre-commit hook from v0.14.10 to v0.15.9, uv pre-commit
hook from 0.9.21 to 0.11.4, and uv version in all GitHub Actions
workflows from 0.11.0 to 0.11.4.
Parenthesize multi-line lambda expressions and use rsplit() for
last-component extraction, matching the updated ruff v0.15.9 rules.
Guard test_body_state() calls with # fmt: off so ruff does not
parenthesize multi-line lambda bodies that Warp's create_warp_function
re-parses via ast.parse (the parenthesized form triggers
IndentationError at runtime). See NVIDIA/warp#1351.

Also inline trivial pass-through lambdas flagged by the new PLW0108
rule.
The lambdas wrapping _setup_kitchen and _setup_tabletop are not
trivial pass-throughs — they defer the name lookup past the
module-level dict definition where the functions are not yet defined.
Add noqa: PLW0108 to suppress the false positive.
@shi-eric shi-eric force-pushed the ershi/pre-commit-ci-update branch from 06fac86 to 1cd2373 Compare April 8, 2026 22:49
@adenzler-nvidia adenzler-nvidia added this pull request to the merge queue Apr 9, 2026
Merged via the queue into newton-physics:main with commit 8d7a6e2 Apr 9, 2026
25 checks passed
jsw7460 pushed a commit to jsw7460/newton that referenced this pull request Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation Issues related to ci/cd and automation in general

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants