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

versions:
  github: python/mypy/tags

dependencies:
  pkgx.sh: ^1

build:
  dependencies:
    python.org: '>=3<3.12'
  env:
    MYPY_USE_MYPYC: 1
    MYPYC_OPT_LEVEL: 3
  script:
    - bkpyvenv stage {{prefix}} {{version}}
    - ${{prefix}}/venv/bin/pip install .
    - bkpyvenv seal {{prefix}} mypy
    - run: |
        ln -s mypy mypyc
        ln -s mypy dmypy
      working-directory: '{{prefix}}/bin'

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

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