Skip to content
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

Question: what are the possible types for the default generated versions file? #527

Closed
henryiii opened this issue Mar 9, 2021 · 4 comments · Fixed by #876
Closed

Question: what are the possible types for the default generated versions file? #527

henryiii opened this issue Mar 9, 2021 · 4 comments · Fixed by #876

Comments

@henryiii
Copy link
Contributor

henryiii commented Mar 9, 2021

I'm adding version.pyi to one of my projects so that mypy doesn't complain when this is missing. But what are the possible types for version_tuple produced here? I'm using this, based on the two things I've seen so far:

version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]

Are there any other lengths of tuple possible? (4, 6, etc)

(would have made this a Discussion if they were activated, as it doesn't require code changes, just a question).

@RonnyPfannschmidt
Copy link
Contributor

i haven't speced that out actually - i believe an if typechecking can be included in the release that drops python < 3.6
i think its a thing that should trigger a code change :)

@henryiii
Copy link
Contributor Author

henryiii commented Mar 9, 2021

This is asking about what could possibly go into version_tuple so a user package can add a version.pyi to sit alongside of a generated version.py file, not about setuptools_scm itself (which would be the scope of #501).

@henryiii
Copy link
Contributor Author

henryiii commented Mar 9, 2021

For an example of a "good" Python 2 drop, see scikit-hep/boost-histogram@v0.13.0...v1.0.0 - changed 2K lines, enabled full type support instead of halfway type checking, and still ended up with fewer lines of code. :)

(pyupgrade via pre-commit was a way to get a nice head start ;) )

@RonnyPfannschmidt
Copy link
Contributor

@henryiii i was thinking of altering the template of the version file to be typed

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

Successfully merging a pull request may close this issue.

2 participants