distributable:
  url: https://github.com/python/mypy/archive/refs/tags/v{{version}}.tar.gz
  strip-components: 1

versions:
  github: python/mypy/tags

dependencies:
  python.org: '>=3<3.12'

build:
  env:
    MYPY_USE_MYPYC: 1
    MYPYC_OPT_LEVEL: 3
  script: |
    python-venv.sh {{prefix}}/bin/mypy
    cp {{prefix}}/bin/mypy {{prefix}}/bin/mypyc
    cp {{prefix}}/bin/mypy {{prefix}}/bin/dmypy

provides:
  - bin/mypy
  - bin/mypyc
  - bin/dmypy

test:
  fixture: |
    a: str = 1
  script: |
    mypy --version | grep {{version}}
    mypyc --version | grep {{version}}
    dmypy --version | grep {{version}}
    echo $(mypy $FIXTURE || true) | grep "Incompatible types in assignment"
