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

Support package ignores for deprecated #18435

Open
kasium opened this issue Jan 10, 2025 · 2 comments
Open

Support package ignores for deprecated #18435

kasium opened this issue Jan 10, 2025 · 2 comments
Labels
feature topic-pep-702 PEP 702, @deprecated

Comments

@kasium
Copy link

kasium commented Jan 10, 2025

Feature

The deprecated check is a great feature, however its tidious if the project checked by mypy is a library which might deprecate functions. These functions are then still exported (e.g. in an init file) and have tests. For all these cases, the deprecated check will find something.

As the mypy config only supports customizations of errors per package but not the customization of packages per rule, this is a missing feature

@kasium kasium added the feature label Jan 10, 2025
@JelleZijlstra JelleZijlstra added the topic-pep-702 PEP 702, @deprecated label Jan 10, 2025
@JelleZijlstra
Copy link
Member

Agree it would be useful to have some way to override deprecations. One possible approach: an option to allow a glob and set the deprecation behavior for anything matching that glob. For example, deprecation_override = [["datetime.*", "ignore"], ["asyncio.*", "error"]].

@tyralla
Copy link
Collaborator

tyralla commented Jan 10, 2025

Here is a related suggestion. Allowing * wildcards seems helpful. However, maybe a nested list is a little inconvenient and offers more flexibilty then usually needed. So, maybe sticking to the mentioned suggestion (e.g. deprecated_exclude = ["m1.*", "m2.f"]) would be favourable (for the majority of users)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-pep-702 PEP 702, @deprecated
Projects
None yet
Development

No branches or pull requests

3 participants