Development¶
I recommend following (or at least reading) all the steps in this doc if you plan on actively developing Mesop.
Setup¶
Bazel/ibazel¶
We use Bazel as our build system. Use bazelisk which ensures the right version of Bazel is used for this project.
If ibazel breaks, but bazel works, try following these steps
TIP: If your build mysteriously fails due to an npm-related error, try running
bazel clean --expunge && rm -rf node_modules
. Bazel and Yarn have a cache bug when upgrading npm modules.
uv¶
We use uv. Follow the instructions here to install uv.
Commit hooks¶
- Install pre-commit
- Install pre-commit hooks for this repo:
pre-commit install
Run local development¶
We recommend using this for most Mesop framework development.
NOTE: this automatically serves the angular app.
Python¶
Third-party packages (PIP)¶
If you update //build_defs/requirements.txt
, run:
venv¶
To support IDE type-checking (Pylance) in VS Code, we use Aspect's rules_py which generates a venv target.
Then, you can activate the venv:
You will need to setup a symlink to have Python IDE support for protos:
Check that you're using venv's python:
Copy the python interpreter path and paste it into VS Code.
Finally, install third-party dependencies.
NOTE: You may need to run the command with
sudo
if you get a permission denied error, particularly with "_distutils_hack".
Commit hooks¶
We use pre-commit to automatically format, lint code before committing.
Setup:
- Install pre-commit.
- Setup git hook:
pre-commit install
Docs¶
We use Mkdocs Material to generate our docs site.
- Activate venv
mkdocs serve