disnake icon indicating copy to clipboard operation
disnake copied to clipboard

fix: warn_deprecated now respect warnings.filter ignores

Open hularuns opened this issue 1 month ago • 3 comments

Summary

Closes #1475

warn_deprecated now respect if a user wants to ignore deprecation warnings by checking if the module name has disnake in it.

test_deprecated_warn tests have been added.

Expected use will be:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning, module = "disnake")

Using simplefilter or not passing a module value will result in the existing behaviour now which forces through the warning, as such this change will not impact current users unless they use the above example, or similar.

warning filters are generally not that large, so there is expected to be a very negligible impact to performance.

Known potential issues with this approach

  • This only currently respects ignore action value for the warnings.
  • literally any module string which has disnake in it will be picked up to be ignored if the action is ignore

Checklist

  • [x] If code changes were made, then they have been tested
    • [ ] I have updated the documentation to reflect the changes
    • [x] I have formatted the code properly by running uv run nox -s lint
    • [x] I have type-checked the code by running uv run nox -s pyright
  • [x] This PR fixes an issue
  • [ ] This PR adds something new (e.g. new method or parameters)
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [x] This PR is not a code change (e.g. documentation, README, ...)

hularuns avatar Nov 14 '25 16:11 hularuns

Documentation build overview

📚 disnake | 🛠️ Build #30332442 | 📁 Comparing 0ff68b39b7c4bc9a638f152fb04a51a1b3fca98c against latest (b325cc45295c814df8aecec19663253f18e475d4)


🔍 Preview build

Show files changed (48 files in total): 📝 48 modified | ➕ 0 added | ➖ 0 deleted
File Status
index.html 📝 modified
whats_new.html 📝 modified
api/abc.html 📝 modified
api/activities.html 📝 modified
api/app_commands.html 📝 modified
api/app_info.html 📝 modified
api/audit_logs.html 📝 modified
api/automod.html 📝 modified
api/channels.html 📝 modified
api/clients.html 📝 modified
api/components.html 📝 modified
api/emoji.html 📝 modified
api/entitlements.html 📝 modified
api/events.html 📝 modified
api/exceptions.html 📝 modified
api/guild_scheduled_events.html 📝 modified
api/guilds.html 📝 modified
api/integrations.html 📝 modified
api/interactions.html 📝 modified
api/invites.html 📝 modified
api/localization.html 📝 modified
api/members.html 📝 modified
api/messages.html 📝 modified
api/misc.html 📝 modified
api/permissions.html 📝 modified
api/roles.html 📝 modified
api/skus.html 📝 modified
api/soundboard.html 📝 modified
api/stage_instances.html 📝 modified
api/stickers.html 📝 modified
api/subscriptions.html 📝 modified
api/ui.html 📝 modified
api/users.html 📝 modified
api/utilities.html 📝 modified
api/voice.html 📝 modified
api/webhooks.html 📝 modified
api/widgets.html 📝 modified
ext/tasks/index.html 📝 modified
ext/commands/api/app_commands.html 📝 modified
ext/commands/api/bots.html 📝 modified
ext/commands/api/checks.html 📝 modified
ext/commands/api/cogs.html 📝 modified
ext/commands/api/context.html 📝 modified
ext/commands/api/converters.html 📝 modified
ext/commands/api/exceptions.html 📝 modified
ext/commands/api/help_commands.html 📝 modified
ext/commands/api/misc.html 📝 modified
ext/commands/api/prefix_commands.html 📝 modified

I'm not sure how the pyright check is failing

hularuns avatar Nov 14 '25 16:11 hularuns

@onerandomusername pyright tests are borked

Enegg avatar Nov 14 '25 20:11 Enegg