mypy icon indicating copy to clipboard operation
mypy copied to clipboard

"--version" option does not produce output matching an existing git tag

Open david-mcdowell-ilw opened this issue 7 months ago • 2 comments

Bug Report

$ mypy --version
mypy 1.15.0 (compiled: yes)

This version output does not match an existing tag in git.

https://github.com/python/mypy/tags https://github.com/python/mypy/releases/tag/v1.15.0

I would expect either the --version option to return the version number with a "v" prefix or the git tags to omit the "v" prefix to match the version output.

The existing behavior causes issues where other tools or users are using the --version output to point to a git tag (e.g., when defining a pre-commit hook, or e.g., when aggregating versions of many linters and formatters like in super-linter).

related issue: https://github.com/super-linter/super-linter/issues/6826

Your Environment

  • Mypy version used: v1.15.0
  • Mypy command-line flags: --version
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.12

david-mcdowell-ilw avatar Jun 03 '25 01:06 david-mcdowell-ilw

You probably don't want to be using this repo (https://github.com/python/mypy) in pre-commit, because pre-commit installs things from source as opposed to wheels. That will lead you to use a pure Python mypy instead of mypyc-compiled mypy, which is maybe 4x slower

hauntsaninja avatar Jun 03 '25 07:06 hauntsaninja

You probably don't want to be using the repo tag in pre-commit, because that will lead you to use a pure Python mypy instead of mypyc-compiled mypy, which is maybe 4x slower

Sorry, I can't find any references to what you're saying here, and I also can't get consistent run times with pre-commit between what should be identical runs to test these differences accurately. Could you explain a bit more?

I am pointing to https://github.com/pre-commit/mirrors-mypy, which has the same version differences but should provide mypyc-compiled mypy (?). Is that right?

david-mcdowell-ilw avatar Jun 03 '25 15:06 david-mcdowell-ilw