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

Add typing annotations #6113

Open
Kroppeb opened this issue Mar 21, 2024 · 5 comments
Open

Add typing annotations #6113

Kroppeb opened this issue Mar 21, 2024 · 5 comments
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@Kroppeb
Copy link

Kroppeb commented Mar 21, 2024

Hi

I'm looking into helping out with solving some issues in pipenv, and was diving through some of the code.

I noticed that there a lot of code doesn't have type annotations or docs with type information.
Is this an intentional choice, or more a lack of necessity and time?

Having typing information would make navigating the code quite a bit more pleasant :)

Ps.
Is there a place where the pipenv team discusses development things outside of github issues?

@matteius
Copy link
Member

Hey @Kroppeb -- sorry I've been away for a bit the start of this year, but I am getting back into pipenv issues now. There isn't a real reason we are lacking type annotations other than the pile of technical debt we are chipping away at -- not so long ago pip-shims and requirementslib/vistir were all part of the equation too but not anymore. We would welcome any community driven PR enhancements that solve problems and/or further help cleanup the codebase. You can find me hanging out in the Python Developers slack group, I am not sure if this invite will work but you can definitely find it or email me -- its on my github profile. https://join.slack.com/t/pythondev/shared_invite/zt-2fcjlo1yc-NisCSxAbN7BT~cP9PKpD6w

@matteius matteius added Type: Enhancement 💡 This is a feature or enhancement request. Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Mar 21, 2024
@Kroppeb
Copy link
Author

Kroppeb commented Apr 8, 2024

@matteius Do you want the types as type annotations, or do you think it's better to specify the types in the docstrings to avoid circular imports?

@matteius
Copy link
Member

matteius commented Apr 9, 2024

I'd prefer type annotations over docstrings -- its more modern and useful in general. I think circular imports can be avoided because you can do you can string quote types we provide that would be a circular import. Like -> "PipFile" (probably not a real example, but for clarity). Also, if we are returning types in a way that create a circular import, longer term we should try refactoring how that code is organized better.

@Kroppeb
Copy link
Author

Kroppeb commented Apr 9, 2024

Good to know, I'll probably make a pr then one of the next few days

@FlavioAmurrioCS
Copy link

@Kroppeb @matteius if work on this hasn't been started, I can try to give it shot. Let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

3 participants