Contributing to EnvPool

Build From Source

See Build From Source.

Adding A New Environment

See Add New Environment into EnvPool.

Lint Check

We use several tools to secure code quality, including

  • Python lint and formatting: ruff;

  • Type check: mypy;

  • C++ Google-style: cpplint, clang-format, clang-tidy;

  • Bazel build file: buildifier;

  • License: addlicense;

  • Documentation: doc8, Sphinx warning checks, and spelling.

The most common shortcuts are:

make ruff        # Python lint
make py-format   # Python formatting check
make docstyle    # doc8 + Sphinx warnings
make spelling    # Documentation spelling check

To automatically format the code, run:

make format

To check if everything conforms to the specification, run:

make lint

Test Locally

This command will run automatic tests in the main directory:

make bazel-test

New families and upstream task extensions must also meet Seed and Randomization Acceptance. Same-seed reproducibility alone does not rule out the frozen reset/goal regression from issue #432.

When using Mesa llvmpipe for headless MuJoCo rendering on Linux, use Mesa 23.1.6 or later, or a distribution package containing its resource lifetime fix. Older drivers can crash when environments render concurrently. The manylinux release jobs build the same pinned Mesa 24.3.4 software renderer for both Linux architectures using third_party/mesa/build_runtime.sh. It is selected only when testing the installed wheels and is not bundled into EnvPool.

To collect a merged Python + C/C++ LCOV report locally, run:

make bazel-coverage
python3 scripts/coverage_summary.py \
  --lcov bazel-out/_coverage/_coverage_report.dat \
  --genhtml-lcov-file coverage/lcov.genhtml.info \
  --repo-root "$PWD"
genhtml coverage/lcov.genhtml.info \
  --prefix "$PWD" \
  --branch-coverage \
  --legend \
  --output-directory coverage/site

The merged LCOV file is written to bazel-out/_coverage/_coverage_report.dat.

If you only want to debug for Bazel build:

# this is for general use case
make bazel-debug
# this is for a special folder "envpool/classic_control"
bazel build //envpool/classic_control --config=debug

If you’d like to run only a single test, for example, testing Mujoco integration; however, you don’t want to build other stuff such as OpenCV:

bazel test --test_output=all //envpool/mujoco:mujoco_gym_align_test --config=test
# or alternatively
cd bazel-bin/envpool/mujoco/mujoco_gym_align_test.runfiles/_main/
./envpool/mujoco/mujoco_gym_align_test

Feel free to customize the command in Makefile!

Documentation

Documentations are written under the docs/ directory as ReStructuredText (.rst) files. index.rst is the main page. A Tutorial on ReStructuredText can be found here.

To compile documentation into the web page, run:

make doc

And the website is in http://localhost:8000