Skip to content

mypy incremental adoption settings - #12971

Closed
nstarman wants to merge 1 commit into
astropy:mainfrom
nstarman:mypy-settings
Closed

nstarman wants to merge 1 commit into
astropy:mainfrom
nstarman:mypy-settings

Conversation

@nstarman

@nstarman nstarman commented Mar 20, 2022 •

Copy link
Copy Markdown
Member

A mypy configuration where all folders are ignored.
As a sub-package adds type hints the module may be removed from the top [[tool.mypy.overrides]] that ignores all errors and sub-package specific settings added in a new [[tool.mypy.overrides]], below.

e.g.

    [[tool.mypy.overrides]]
    module="*/astropy/cosmology/*"
    ignore_errors = false
    ...

todo:

  • add a mypy pre-commit hook to check the type hints.

If anyone is familiar with setting up a mypy configuration, please suggest improvements!

Non-goals

  1. type-hint anything in this PR.
  2. force any sub-package to start adding type hints
  3. decide where type hints will be stored: in the code, or as type stubs in a separate directory.4.

Goals

have a quality setup that:

  1. allows any sub-package to start adding type hints.
  2. works for either type hint location.

Checklist for package maintainer(s)

Signed-off-by: Nathaniel Starkman (@nstarman) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@nstarman nstarman linked an issue Mar 20, 2022 that may be closed by this pull request
@nstarman
nstarman requested a review from Cadair March 20, 2022 19:47
Comment thread pyproject.toml
[[tool.mypy.overrides]]
module = [
"astropy/logger",
"*/_erfa/*",

@nstarman nstarman Mar 20, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this can be simplified to "astropy/_erfa/*", and similarly for the other modules.

@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Aug 18, 2022
@github-actions

Copy link
Copy Markdown
Contributor

Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock.

If you believe I commented on this pull request incorrectly, please report this here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Close? Tell stale bot that this issue/PR is stale installation no-changelog-entry-needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opt-in mypy settings

1 participant