0

I have .pre-commit set with the following config:

repos:
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.3.0
    hooks:
      - id: mypy
        additional_dependencies: [types-requests,types-python-dateutil,types-PyYAML]

I wonder where this types- comes from. I tried to add a few, like say: types-boto3 it works, but I do not understand why (or rather: to what it's mapped, by whom, and where is it defined).

I tried googling for the list of possible additional dependencies but my googling skills are not good enough. For example, googling after types-boto3 leads me to: https://mypy-boto3.readthedocs.io/en/latest/. But again, why?

anthony sottile
  • 61,815
  • 15
  • 148
  • 207
Drachenfels
  • 3,037
  • 2
  • 32
  • 47
  • Try `mypy --install-types` to find some common ones used in your code. The rest can be detected with `ignore_missing_imports = false` in config file (you'll get a bunch of `module is installed, but missing library stubs or py.typed marker [import]` errors. For boto3, `mypy` found wrong types: you should use `boto3-stubs[s3,lambda]` (services you use enumerated as optional deps). You can read about files source [here](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-install-types). – STerliakov Jun 13 '23 at 19:14
  • 2
    they are just packages on pypi -- https://pypi.org/p/types-requests for example – anthony sottile Jun 13 '23 at 21:58

0 Answers0