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

WIP type annotations #1442

Closed
wants to merge 1 commit into from
Closed

Conversation

KotlinIsland
Copy link
Contributor

@KotlinIsland KotlinIsland commented Aug 29, 2022

Very WIP

Contains:

  • partial type annotations for some modules
  • github workflow integration

addresses: #1434

@@ -10,13 +10,13 @@

import sys

from coverage.version import __version__, __url__, version_info
from coverage.version import __version__ as __version__, __url__ as __url__, version_info as version_info
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add these as clauses? They're the same names they already were.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In python typing, this nonsense is semantically understood as "re-export this import as a public member of the module".

I believe this crude hack was made because they didn't want to introduce any new syntax for typing.

It is mentioned in pep-484

@nedbat
Copy link
Owner

nedbat commented Aug 29, 2022

I haven't looked at this closely, but do you have a way to run mypy as part of the tools?

@KotlinIsland
Copy link
Contributor Author

I haven't looked at this closely, but do you have a way to run mypy as part of the tools?

I'm unfamiliar with your project configuration (make, pip-compile) but I can give it a go.

@nedbat
Copy link
Owner

nedbat commented Aug 30, 2022

Thanks for taking this all on. I added some details to the Contributing section of the docs about dependencies and make upgrade, though I wonder if I've added enough? Can you take a look and let me know? Thanks so much.

@nedbat
Copy link
Owner

nedbat commented Nov 6, 2022

What is the future of this pull request? It might be too hard to get everything type-checked, since the master branch is continuing development. Is there a way to get the tooling in place, and gradually make progress on adding the annotations?

@KotlinIsland
Copy link
Contributor Author

Hmm, sure. I could clean this up and get a minimal state ready to merge when I get time.

@Kludex
Copy link
Contributor

Kludex commented Nov 9, 2022

What is the future of this pull request? It might be too hard to get everything type-checked, since the master branch is continuing development. Is there a way to get the tooling in place, and gradually make progress on adding the annotations?

@nedbat On uvicorn, we created an issue to track our progress: encode/uvicorn#998.

Each PR had an entry on the mypy configuration file (setup.cfg for us).

I can create a similar issue for coverage, and help to coordinate, if wanted.

@nedbat
Copy link
Owner

nedbat commented Dec 27, 2022

I started a more gradual approach. As of 212f652, four files on master are checked with mypy. I'd be happy to have help adding more files gradually, and eventually making the checks more strict and complete. I'll close this PR now, but feel free to re-open it if you can make this way work with the latest code.

@nedbat nedbat closed this Dec 27, 2022
@nedbat
Copy link
Owner

nedbat commented Jan 13, 2023

As of now (commit b059a67), all of the files in coverage/ and tests/ are checked by mypy.

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 this pull request may close these issues.

None yet

3 participants