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

[Feature Request] Support type hints #138

Open
q-wertz opened this issue Nov 3, 2022 · 5 comments
Open

[Feature Request] Support type hints #138

q-wertz opened this issue Nov 3, 2022 · 5 comments
Labels
Status:CodeWelcome This feature design has been approved; next step: write the code! Topic:API Improvements to the library API Type:Enhancement
Milestone

Comments

@q-wertz
Copy link

q-wertz commented Nov 3, 2022

It would be nice if this package supports type hints (for reference e.g. PEP 484 and PEP 561).

Can help you with the type annotation work.

@rbarrois
Copy link
Owner

rbarrois commented Nov 4, 2022

Indeed, that's a good idea! Although the library currently provides support for old Python version — it's a semantic versioning library after all 😉

I don't have lots of time right now (either for coding or reviewing), but hope to be able to look at this over the next few weeks ;)

@rbarrois rbarrois added Type:Enhancement Topic:API Improvements to the library API labels Nov 4, 2022
@q-wertz
Copy link
Author

q-wertz commented Nov 4, 2022

Nice to hear :)

You want to keep the python 2.7 support?

Maybe one could use PEP 484 or don't add the type hints in the code but generate a stub file.

@plannigan
Copy link

I started playing around with this. The existence of partial make things more complicated, but likely still doable. Since it and a number of other things are already marked for removal, I think it would be best work towards that new major version, then include type hints. The decision to drop unsupported older python versions, as part of the new major version, would have an effect on how the hints we implemented.

@rbarrois
Copy link
Owner

@plannigan That's a great approach indeed, I totally support it. Let me know if you have some code to use as a basis, otherwise I'll follow your recommendation for version 3.0 :)

@rbarrois rbarrois added this to the 3.x milestone Feb 28, 2023
@rbarrois rbarrois added the Status:CodeWelcome This feature design has been approved; next step: write the code! label Feb 28, 2023
@plannigan
Copy link

Actually, I do. Since I didn't get a response, I made an independent implementation in the tool I was using this library in. It isn't a full implementation because I hyper-bump-it doesn't need the reversion range specification, but I'm happy with how it ended up.

I can put it up as a PR, but I'm not sure how much work it would be to make the rest of the code base compatible with the API changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:CodeWelcome This feature design has been approved; next step: write the code! Topic:API Improvements to the library API Type:Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants