Skip to content

alexmirrington/rules_mypy

Repository files navigation

rules_mypy

Overview

rules_mypy aims to make the process of adding mypy type-checking to your existing rules_python targets as seamless as possible, through the use of Bazel aspects.

With this approach, we get all the benefits of rules_python for Python builds and packaging, as well as rules_python_gazelle_plugin for build file generation.

Usage

Refer to the latest release for information on how to integrate these rules into your monorepo.

Features and Roadmap

  • Integration with rules_python and gazelle for basic mypy type-checking via aspects
  • Integration with rules_proto_grpc for protobuf and gRPC type stubs
  • Virtual environment isolation and hermetic toolchain integration
  • Support as an external repo
  • bzlmod support

Developing

  • Install Bazelisk to easily get up and running with the right version of Bazel for the project.

Acknowledgements

The source code in this repo was initially inspired by bazel-mypy-integration, with added PEP-561 and protobuf/gRPC type stub support.