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

chore: run mypy in CI #2789

Merged
merged 3 commits into from
Nov 1, 2023
Merged

chore: run mypy in CI #2789

merged 3 commits into from
Nov 1, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Oct 31, 2023

This PR enables mypy checks on a subset of the codebase and runs it as part of CI.
Right now, we don't publicly declare type-hints via py.typed, so these are only used internally.

Some things don't type super well; the Sentinel singleton doesn't seem very easy to handle. The closest we could get I think is to use e.g.

import enum
from typing import Literal


class Unset(enum.Enum):
    TOKEN = enum.auto()


def func_with_defaults(x: int, y: int | Literal[Unset.TOKEN]):
    ...

But for now, we'll just ignore this part of the typing.

We're not running in strict mode, so this only checks places where we declare types.

@agoose77 agoose77 marked this pull request as ready for review October 31, 2023 21:27
@agoose77 agoose77 enabled auto-merge (squash) October 31, 2023 21:27
@agoose77 agoose77 temporarily deployed to docs October 31, 2023 22:21 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs October 31, 2023 22:39 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs November 1, 2023 01:39 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs November 1, 2023 02:19 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs November 1, 2023 10:42 — with GitHub Actions Inactive
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #2789 (65fc760) into main (c316114) will decrease coverage by 0.05%.
The diff coverage is 75.62%.

Additional details and impacted files
Files Coverage Δ
src/awkward/_backends/backend.py 88.09% <100.00%> (+0.59%) ⬆️
src/awkward/_backends/cupy.py 66.66% <100.00%> (ø)
src/awkward/_backends/dispatch.py 92.85% <100.00%> (ø)
src/awkward/_backends/jax.py 100.00% <100.00%> (ø)
src/awkward/_backends/numpy.py 100.00% <100.00%> (ø)
src/awkward/_backends/typetracer.py 78.12% <100.00%> (ø)
src/awkward/_kernels.py 66.95% <100.00%> (ø)
src/awkward/_nplikes/dispatch.py 96.00% <100.00%> (ø)
src/awkward/_nplikes/numpy.py 94.44% <100.00%> (ø)
src/awkward/_typing.py 92.85% <100.00%> (ø)
... and 23 more

@agoose77 agoose77 enabled auto-merge (squash) November 1, 2023 11:25
@agoose77
Copy link
Collaborator Author

agoose77 commented Nov 1, 2023

65fc760 fixes an existing bug, but a new assertion caught it.

@agoose77 agoose77 merged commit 23f5322 into main Nov 1, 2023
36 checks passed
@agoose77 agoose77 deleted the agoose77/chore-run-mypy branch November 1, 2023 11:44
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.

1 participant