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

Make mypy pass and add it to CI #612

Merged
merged 9 commits into from
May 31, 2024
Merged

Make mypy pass and add it to CI #612

merged 9 commits into from
May 31, 2024

Conversation

sirosen
Copy link
Collaborator

@sirosen sirosen commented May 31, 2024

In short, get type checking to pass and start enforcing it.

  • Refine mypy config
  • Add type-ignores for testsuite stdio manipulations
  • Add type-ignores to 'test_such.py'
  • Handle type errors in nose/plugins/
  • Fix type annotations for tomllib/tomli
  • Set the type of Event._attrs
  • Refine typing of conditional imports
  • Add type-ignore comments to functional tests
  • Add mypy run to CI

sirosen added 9 commits May 30, 2024 21:06
Also remove some obsolete flake8 ignores (from an older version of
flake8, IIRC).
Minor adjustments to pass mypy. Mostly applying some missing
annotations.
For one of these, the fix is actually to annotate a type in
`nose2/events.py`.
This fixes a number of mypy errors.

Additionally, replace a lambda to allow for better type inference
(removes a misc mypy error).
Using ModuleType is a little heavy-handed. Avoiding it, a lighter
touch, better preserves information about the optional modules.
Specifically, various tests which assign attributes to functions need
attr-defined ignore rules.
@sirosen sirosen merged commit 73b0272 into main May 31, 2024
24 checks passed
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