lablup / lablup/backend.ai

Enable mypy "deprecated" error code

Open
#13,231 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.