Skip to content

Remove deprecated aliases, after a 1.x release that warns about them #314

Closed

Description

@lesnik512

AGENTS.md's rule "A public rename ships a silent alias" (AGENTS.md:51-53) means none of the old names warns today, so deleting them in 2.0 would break importers with no notice. A last 1.x minor that emits DeprecationWarning on each of them gives that notice; 2.0 then deletes them.

Name Where Since Use instead
OpentelemetryConfig lite_bootstrap/instruments/opentelemetry_instrument.py:372-373 1.0.0 (#103) OpenTelemetryConfig
FreeBootstrapperConfig lite_bootstrap/bootstrappers/free_bootstrapper.py:37-38, re-exported at lite_bootstrap/__init__.py:4,27 1.0.0 (#103) FreeConfig
IGNORED_STRUCTLOG_ATTRIBUTES lite_bootstrap/instruments/sentry_instrument.py:28-30 1.2.0 (#129) logging_factory.STRUCTLOG_META_KEYS
_RENAMED_ATTRIBUTES forwarding of not_ready_message and check_dependencies on instruments lite_bootstrap/instruments/base.py:38-56 1.6.0 (#196) not_configured_reason, dependencies_installed
AddressProtocol, RequestProtocol, ScopeType defined at lite_bootstrap/instruments/logging_factory.py:15-27, re-exported at logging_instrument.py:9-15,56-64 1.0.0 (#99) none; nothing in lite_bootstrap, tests or docs uses them

MemoryLoggerFactory stays exported from logging_instrument, because the module uses it itself and tests/instruments/test_logging_instrument.py:13 imports it from there. InstrumentSkippedWarning also stays: tests/conftest.py:22-30 filters on it.

Work

1.x release first:

  • Test first: one test per name that accessing it raises a DeprecationWarning naming the replacement (pytest.warns), and that a subclass defining not_ready_message or check_dependencies warns at class creation. All fail today.
  • Replace each alias assignment with a module __getattr__ that warns and returns the new object. For FreeBootstrapperConfig, do it in both free_bootstrapper.py and lite_bootstrap/__init__.py, and drop it from __all__ so from lite_bootstrap import * does not warn. If Import bootstrappers lazily from lite_bootstrap/__init__.py #308 lands first, the package-level __getattr__ already exists.
  • In BaseInstrument.__init_subclass__, warn when a legacy name is forwarded. Use warn_at_caller with category=DeprecationWarning.
  • The alias rule in AGENTS.md:51-53 (a rename ships an alias that warns for one minor and goes in the next major) is rewritten by Write the versioning policy into AGENTS.md #323, which owns that text.

2.0:

  • Delete the five items above, _RENAMED_ATTRIBUTES and the __init_subclass__ override with it, and the protocol definitions in logging_factory.py.
  • Delete tests/instruments/test_base_instrument.py:13-42 and the CONTEXT.md sentence at CONTEXT.md:39-40 ("An instrument written against the old not_ready_message still works").
  • AGENTS.md:53 uses OpentelemetryConfig as the worked example of the alias rule; pick another example or describe the pattern without one.

Verify: the 1.x tests pass with no other warnings, and after the 2.0 removal grep finds none of the names outside the changelog.

Breaking in 2.0 for code importing any of these names, and for out-of-tree instruments that still define not_ready_message or check_dependencies: their skip reason goes empty and their dependency check silently returns True.

Activity

  1. added this to the 2.0.0 milestone on Oct 24, 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 requestneeds-triageMaintainer needs to evaluate this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions