mjlab/CLAUDE.md
Upstream Snapshot 32a241c28f
Some checks failed
nightly / Test against latest dependencies (py3.10) (push) Has been cancelled
nightly / Test against latest dependencies (py3.13) (push) Has been cancelled
tests / tests (3.13, locked) (push) Has been cancelled
tests / tests (3.13, unlocked) (push) Has been cancelled
tests / pyright (3.10) (push) Has been cancelled
tests / lint-format (push) Has been cancelled
tests / tests (3.10, locked) (push) Has been cancelled
tests / tests (3.11, locked) (push) Has been cancelled
tests / tests (3.12, locked) (push) Has been cancelled
tests / pyright (3.11) (push) Has been cancelled
tests / pyright (3.12) (push) Has been cancelled
tests / pyright (3.13) (push) Has been cancelled
tests / ty-check (3.10) (push) Has been cancelled
tests / ty-check (3.11) (push) Has been cancelled
tests / ty-check (3.12) (push) Has been cancelled
tests / ty-check (3.13) (push) Has been cancelled
tests / stubs (push) Has been cancelled
tests / smoke-test (push) Has been cancelled
Docker / check_paths (push) Has been cancelled
docs / build (push) Has been cancelled
Docker / build (push) Has been cancelled
Import upstream snapshot c19f713c415a699a79d71cd96aa13c3104a05047
Upstream: https://github.com/michaelgillett/mjlab
Upstream-Commit: c19f713c415a699a79d71cd96aa13c3104a05047
Upstream-Branch: main
2026-08-28 15:42:17 +08:00

2.0 KiB

Development Workflow

Always use uv run, not python.


# 1. Make changes.

# 2. Type check.
uv run ty check  # Fast
uv run pyright  # More thorough, but slower

# 3. Run tests.
uv run pytest tests/  # Single suite
uv run pytest tests/<test_file>.py  # Specific file

# 4. Format and lint before committing.
uv run ruff format
uv run ruff check --fix

We've bundled common commands into a Makefile for convenience.

make format     # Format and lint
make type       # Type-check
make check      # make format && make type
make test-fast  # Run tests excluding slow ones
make test       # Run the full test suite
make docs       # Build documentation

Always run make check before committing. This runs formatting, linting, and type checking. Do not commit code that fails type checking.

Before creating a PR, ensure all checks pass with make test.

When making user-facing changes, add an entry to docs/source/changelog.rst under the "Upcoming version (not yet released)" section using Added/Changed/Fixed categories. Reference issues with :issue:\123`` (renders as a link to the GitHub issue).

Commits and PRs

  • Put Fixes #<number> at the end of the commit message body, not in the title.
  • PR body should be plain, concise prose. No section headers, checklists, or structured templates. Describe the problem, what the change does, and any non-obvious tradeoffs. A good PR description reads like a short paragraph to a colleague, not a form.
  • PR and commit messages are rendered on GitHub, so don't hard-wrap them at 88 columns. Let each sentence flow on one line.

Some style guidelines to follow:

  • Line length limit is 88 columns. This applies to code, comments, and docstrings.
  • Avoid local imports unless they are strictly necessary (e.g. circular imports).
  • Tests should follow these principles:
    • Use functions and fixtures; do not use test classes.
    • Favor targeted, efficient tests over exhaustive edge-case coverage.
    • Prefer running individual tests rather than the full test suite to improve iteration speed.