You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Thank you for all of the work on this package ❤️
I wanted to flag up that since setuptools_scm==8.0.1, the dynamically generated version file contains type hints that are only valid on python >=3.9
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '0.55.1.dev4' # type: str
__version_tuple__ = version_tuple = (0, 55, 1, 'dev4') # type: tuple[int | str, ...]
(python 3.8)
> mypy version.py
version.py:4: error: Unexpected "..." [misc]
version.py:4: error: "tuple" is not subscriptable, use "typing.Tuple" instead [misc]
version.py:4: error: Incompatible types in assignment (expression has type "Tuple[int, int, int, str]", variable has type "Tuple[Union[int, str], Any]") [assignment]
Found 3 errors in 1 file (checked 1 source file)
Unless specifically excluding the version file from type checking, I imagine that this is very likely to lead to broken CI/CD pipelines in most workflows.
I think that removing the inline type annotations from the version file (like in setuptools_scm<8.0.0) or adding a from __future__ import annotations at the top of the file would solve the problem
The text was updated successfully, but these errors were encountered:
( Might be worth making sure to have a blank line under the from __future__ import annotations just in case users are running black on that file too :) )
# file generated by setuptools_scm
# don't change, don't track in version control
from __future__ import annotations
__version__ = version = "0.55.1.dev4" # type: str
__version_tuple__ = version_tuple = (0, 55, 1, "dev4") # type: tuple[int | str, ...]
i wonder if this ought to be a mypy bug as well, i was under the impression the future import was just to stop evaluating, the comments aren't evaluated to begin with
Hello! Thank you for all of the work on this package ❤️
I wanted to flag up that since
setuptools_scm==8.0.1
, the dynamically generated version file contains type hints that are only valid on python>=3.9
Unless specifically excluding the version file from type checking, I imagine that this is very likely to lead to broken CI/CD pipelines in most workflows.
I think that removing the inline type annotations from the version file (like in
setuptools_scm<8.0.0
) or adding afrom __future__ import annotations
at the top of the file would solve the problemThe text was updated successfully, but these errors were encountered: