-
Notifications
You must be signed in to change notification settings - Fork 79
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
mypy: analyze types in all possible libraries #658
base: main
Are you sure you want to change the base?
Conversation
d24ba30
to
08a9af9
Compare
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #658 +/- ##
==========================================
- Coverage 83.64% 83.61% -0.03%
==========================================
Files 79 79
Lines 6230 6239 +9
==========================================
+ Hits 5211 5217 +6
- Misses 1019 1022 +3
☔ View full report in Codecov by Sentry. |
but
I'm relying on the test suite and/or your knowledge of what's cc @beenje |
0f6a482
to
3813b10
Compare
11f0891
to
e0cf4ab
Compare
It looks like the test The link to the job: https://github.com/mamba-org/quetz/actions/runs/6065939126/job/16455972862?pr=658 |
Hey @rominf indeed, that test is unfortunately flaky (has been this way since a rather long time). |
Preparation for mamba-org#646 * Remove `ignore_missing_imports = true` from mypy configuration. * Run mypy in the same environment instead of separate to check types in dependencies like fastapi. * Move mypy dependencies from pre-commit configuration to `setup.cfg`. * Update mypy dependencies there. * Move `rq` from `environment.yml` to `setup.cfg`: conda-forge version: 1.9.0, pypi version : 1.15.1 (two years difference; types were added). * Add libraries with missing types to ignore list in mypy configuration. * Add pydantic mypy plugin. * Allow running mypy without explicit paths. * Update GitHub Actions. * Temporarily add ignore `annotation-unchecked` to make mypy pass. * Fix new mypy issues: * Use https://github.com/hauntsaninja/no_implicit_optional to make `Optional` explicit. * If there is no default, the first `pydantic.Field` argument should be omitted (`None` means that the default argument is `None`). * Refactor `_run_migrations`. There were two different paths: one for normal execution and another one for testing. Simplify arguments and the function code, and introduce a new mock `run_migrations`. * To preserve compatibility, introduce `ChannelWithOptionalName` for the `/channels` patch method. Note that the solution is a bit dirty (I had to use `type: ignore[assignment]`) to minimize the number of models and the diff. * Trivial errors.
e0cf4ab
to
deda79d
Compare
Rebased, now tests pass. |
A reminder about the PR. Feel free to close the PR if its continuation is not beneficial. I am open to rebasing and improving it though. |
Preparation for #646
ignore_missing_imports = true
from mypy configuration.in dependencies like fastapi.
setup.cfg
.rq
fromenvironment.yml
tosetup.cfg
: conda-forge version:1.9.0, pypi version : 1.15.1 (two years difference; types were added).
configuration.
annotation-unchecked
to make mypy pass.Optional
explicit.pydantic.Field
argument shouldbe omitted (
None
means that the default argument isNone
)._run_migrations
. There were two different paths: one fornormal execution and another one for testing. Simplify arguments and
the function code, and introduce a new mock
run_migrations
.ChannelWithOptionalName
forthe
/channels
patch method. Note that the solution is a bit dirty(I had to use
type: ignore[assignment]
) to minimize the number ofmodels and the diff.