Contributing to EnvPool ======================= Build From Source ----------------- See :doc:`/content/build`. Adding A New Environment ------------------------ See :doc:`/content/new_env`. 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: .. code-block:: bash 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: .. code-block:: bash make format To check if everything conforms to the specification, run: .. code-block:: bash make lint Test Locally ------------ This command will run automatic tests in the main directory: .. code-block:: bash make bazel-test To collect a merged Python + C/C++ LCOV report locally, run: .. code-block:: bash 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: .. code-block:: bash # 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: .. code-block:: bash 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/envpool/ ./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: .. code-block:: bash make doc And the website is in `http://localhost:8000 `_