Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
david-mcdowell-ilw opened this issue Jun 3, 2025 · 2 comments
Labels
bug mypy got something wrong

Comments

@david-mcdowell-ilw
Copy link

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: super-linter/super-linter#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 david-mcdowell-ilw added the bug mypy got something wrong label Jun 3, 2025
@david-mcdowell-ilw david-mcdowell-ilw changed the title --version option output does not match any existing git tags "--version" option does not produce output matching an existing git tag Jun 3, 2025
@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jun 3, 2025

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

@david-mcdowell-ilw
Copy link
Author

david-mcdowell-ilw commented Jun 3, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants