-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Description
The current setuptools_scm generates an (mypy) invalid version.py for python 3.8.
The current version generates something like:
# file generated by setuptools_scm
# don't change, don't track in version control
from __future__ import annotations
__version__ = version = '2.0.2.dev217' # type: str
__version_tuple__ = version_tuple = (2, 0, 2, 'dev217') # type: tuple[int | str, ...]
While previous version did something like:
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '2.0.2.dev70'
__version_tuple__ = version_tuple = (2, 0, 2, 'dev70')
The new added typing is invalid in python 3.8's mypy:
$ mypy -p ${PYTHON_PACKAGE_NAME} --ignore-missing-imports
x/version.py:4: error: Unexpected "..." [misc]
x/version.py:4: error: "tuple" is not subscriptable, use "typing.Tuple" instead [misc]
x/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]
The commit defc575 introduced the bug (Jul 12 2023) by @RonnyPfannschmidt
and references issue #527
This is breaking many of my pipelines, and probably soon many other people's.
Please, consider a more flex typing while python 3.8 hasn't reached it's EOL.
Thank you, this package is great and helps a lot on my python's packages!
gjulianm
Metadata
Metadata
Assignees
Labels
No labels