-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Complete type annotations in pip/_internal/index
#10111
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
Complete type annotations in pip/_internal/index
#10111
Conversation
Convert type hint commentaries into annotations for `pip/_internal/index`
This is the news entry for my pull request.
The
Maybe the original annotations were wrong. How can I fix them? |
What's happening is that HTMLPage is defined after the function you're annotating. The comments didn't hit any issue, since they aren't executed by the Python interpreter, so only mypy is doing a lookup. Changing the failing |
Ok. I will take that tomorrow (it's late here). Thanks @pradyunsg! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the HTMLPage
annotations need to use strings (forward reference issues). There are a few other linter errors as well.
https://mypy.readthedocs.io/en/stable/common_issues.html#issues-with-code-at-runtime
Ok, got it. Unfortunately, I think I will be a quite busy for this month (things are getting harder on the real world!). But maybe the next week I can take a look for that (It's Friday here). Thanks @uranusjr! |
@DiddiLeija @uranusjr @pradyunsg Can I work on type-comments to type-annotations translation as well? I have worked on something similar in https://github.com/optuna/optuna and would like to help. |
Feel free, as long as you don’t step on each other’s toes 🙂 |
Hey @harupy. Thanks! Maybe we can coordinate, to be more accurate on our work. I will work on this folders:
And maybe you can take the rest, or someone else could take them (they are a lot of files, so any kind of help is useful...). |
@DiddiLeija Got it! |
I'm using this package to automatically translate type comments into type annotations: |
Make them fit to the flake8 test.
Convert some type annotations into strings.
I finally fixed the |
Side note: I wanted to say |
I annotated an argument wrong.
Seems like "tag" is not defined, so I just annotated as a string.
Hum... Seems like there is a wrong annotation. Look at this error message:
Even when the annotation is a string, it fails! Maybe the annotation is wrong. Can somebody tell me what's going on here? |
Maybe "tag" was originally "Tag". I fixed that simple mistake.
Oh, forget it. It was |
These changes were suggested by the flake8 test.
flake8 told me they were too long.
Convert type hint commentaries into annotations, this time for
pip/_internal/index
.