Skip to content

Delete deprecated_module_getattr and _renamed_fields #400

Open

Description

@lesnik512

deprecated_module_getattr (lite_bootstrap/helpers/warn.py:40-61) has no callers in the package, and BaseConfig._renamed_fields (instruments/base.py:22) is {} on every config. #367 removed the 1.x names and fields that used them. Only their tests keep them alive (tests/test_deprecated_aliases.py, tests/test_renamed_config_fields.py).

Found in the 2.0 audit. Decision: delete them. The next rename brings back whatever it needs, and #350 and #351 show how.

Work

  • helpers/warn.py: delete deprecated_module_getattr and NEXT_MAJOR_VERSION. warn_at_caller stays, since the instruments and bootstrappers use it.
  • instruments/base.py: delete _renamed_fields and the forwarding loop in BaseConfig.__post_init__. Keep __post_init__ itself, because four subclasses call super().__post_init__() and it ends that chain. Trim its docstring to say only that.
  • Drop the UNSET and UnsetType imports from instruments/base.py. fastapi_bootstrapper.py still uses both, so types.py stays.
  • Delete tests/test_deprecated_aliases.py and tests/test_renamed_config_fields.py.
  • AGENTS.md, "Versioning": the rename bullet keeps the rule (the old name works with a DeprecationWarning for at least one minor, and the next major deletes it) but stops naming the two helpers. Point to feat: warn on deprecated aliases ahead of their removal in 2.0 #350 and feat: rename inconsistent config fields, keeping the old names as deprecated aliases #351 for how the last rename did it.

Breaking changes

None for users. Both helpers are internal: lite_bootstrap.helpers.warn isn't re-exported, and _renamed_fields is private.

Activity

  1. added this to the 2.0.0 milestone on Oct 29, 2026
  2. added
    questionFurther information is requested
    enhancementNew feature or request
    and removed
    questionFurther information is requested
    on Oct 29, 2026
  3. changed the title [-]Decide whether to keep deprecated_module_getattr and _renamed_fields in 2.0[/-] [+]Delete deprecated_module_getattr and _renamed_fields[/+] on Oct 29, 2026
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions