Enable mypy "deprecated" error code
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
Enable the `deprecated` error code in the mypy configuration so that imports and usages of items marked with `@warnings.deprecated` / `@typing_extensions.deprecated` (PEP 702) are reported at type-check time.
Reference: [https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-imported-or-used-feature-is-deprecated-deprecated](https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-imported-or-used-feature-is-deprecated-deprecated)
### Scope
- Add `"deprecated"` to `enable_error_code` under `[tool.mypy]` in `pyproject.toml`.
- Run `pants check ::` and fix all newly reported usages of deprecated APIs (migrate to the replacement API, or adjust per-module overrides only when migration is not feasible).
JIRA Issue: BA-7066
Contributor guide
Research direction
Start in pyproject.toml at the [tool.mypy] enable_error_code setting, then run pants check :: to collect newly reported deprecated usages. For each report, inspect the replacement API and migrate it, using a per-module override only when migration is not feasible. Done means the deprecated error code is enabled and pants check :: passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100