As a follow-on to our recent open-sourcing of the remainder of the MAX Python API, you can now run all MAX Python API unit and integration tests in the modular repository. This means that you can make additions or modifications to these Python APIs, test them locally, and then submit those changes in a PR that will be tested in CI.
This works in the same way as modifications and tests do for the Mojo standard library or MAX Mojo kernels: using Bazel to coordinate building any local changes and running tests against them. For example, you can run all unit tests against the MAX APIs via
./bazelw test //max/tests/tests/...
or against a specific module using syntax like
./bazelw test //max/tests/tests/torch:all
One caveat: this will test local modifications to Python APIs, but won’t yet pull in changes to the local Mojo standard library or MAX kernels libraries. We’re working on having the graph compiler pull in locally-built Mojo libraries over those shipped in the max package, and when that is enabled you’ll also be able to test your own custom kernels and other Mojo enhancements inside of graphs and models.
Overall, this means that we’re now open to taking contributions to the MAX Python APIs, models, and more in the modular repository. If you have any difficulties testing locally or submitting changes in pull requests, let us know here or in GitHub issues.