Skip to content

Allow per-package configuration of category #26

Description

@flying-sheep

Description of feature

One idea I had: the default of FutureWarning across the board is good for our usual use case (=libraries that are usually used directly and not by other libraries), but it’s inconvenient to override, as you’d want to override it on a (toplevel import or distribution) package level.

I wonder if we could introduce a new default for the category args. If we at any point introduce a non-declarative API that raises a warning, we could also use that to set the default skip_file_prefixes.

E.g. directly in the body of the function, this would get the caller module name: inspect.getmodule(inspect.stack()[1].frame).__name__

The only issue would be if anyone wraps our decorator, as that would mean the call site is wherever the wrapper is defined.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions