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

Explore adding static typing #10865

Closed
di opened this issue Mar 3, 2022 · 4 comments
Closed

Explore adding static typing #10865

di opened this issue Mar 3, 2022 · 4 comments
Labels
developer experience Anything that improves the experience for Warehouse devs

Comments

@di
Copy link
Member

di commented Mar 3, 2022

We should determine a way that we can gradually add static typing (and ensure that we're able to assert that it is correct in CI) without introducing a single massive PR.

@di di added the developer experience Anything that improves the experience for Warehouse devs label Mar 3, 2022
@fizyk
Copy link
Contributor

fizyk commented Mar 3, 2022

mypy has configuration options that would allow doing that gradually

https://mypy.readthedocs.io/en/stable/config_file.html

We could either include paths that got converted or exclude those that do not (this would require all new ones to already be typed)

@miketheman
Copy link
Member

I'm interested in this kind of work.

A few questions/decisions arise at this juncture:

  • Is mypy considered a lint tool, or a testing tool? (for requirements inclusion) I think lint - from the mypy docs:

    As mypy is a static analyzer, or a lint-like tool, ...

  • Is there a particular entry point or an area of focus? We can also follow the recommended path
  • Where do we want to configure mypy? I'm partial to pyproject.toml, but that's not currently mounted to the developer container - should we mount that as well?

@di
Copy link
Member Author

di commented Mar 7, 2022

Is mypy considered a lint tool, or a testing tool? (for requirements inclusion)

I think this belongs with our linters.

Is there a particular entry point or an area of focus? We can also follow the recommended path

There are some existing types that @fizyk did that could be a good starting point. Other good starting points would be our more critical codepaths.

Where do we want to configure mypy? I'm partial to pyproject.toml, but that's not currently mounted to the developer container - should we mount that as well?

Using pyproject.toml is preferable, and this should already be getting included in the dev container, as there's configuration for other linters and pytest in there as well

@miketheman
Copy link
Member

I think this can be closed now, as we have a mechanism for adding more types as gradually as we want to now.

@di di closed this as completed Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer experience Anything that improves the experience for Warehouse devs
Projects
None yet
Development

No branches or pull requests

3 participants