Check out GitHub - rospypi/rosidl_generator_mypy
This works at build time only so you’ll need to build any messages from source to get it to work.