run_mypy.sh 836 B

12345678910111213
  1. #!/bin/bash
  2. set -e
  3. pip install --upgrade 'mypy>=0.902'
  4. pip install types-pytz types-requests types-Flask types-click types-redis types-tzlocal types-python-dateutil types-setuptools types-tabulate types-PyYAML
  5. # We are checking python files which have type hints, and leave out bigger issues we made issues for
  6. # * data/scripts: We'll remove legacy code: https://trello.com/c/1wEnHOkK/7-remove-custom-data-scripts
  7. # * data/models and data/services: https://trello.com/c/rGxZ9h2H/540-makequery-call-signature-is-incoherent
  8. files=$(find flexmeasures \
  9. -not \( -path flexmeasures/data/scripts -prune \) \
  10. -not \( -path flexmeasures/data/models -prune \) \
  11. -not \( -path flexmeasures/data/services -prune \) \
  12. -name \*.py | xargs grep -l "from typing import")
  13. mypy --follow-imports skip --ignore-missing-imports $files