Repository navigation
Remove the names and config fields deprecated in 1.x - #367
Merged
Merged
Conversation
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #314.
Closes #318.
This deletes everything that 1.16.0 deprecated. That release added the
DeprecationWarnings (#350), so the 2.0 half of both issues is now due.Removed
From #314:
OpentelemetryConfig(opentelemetry_instrument)OpenTelemetryConfigFreeBootstrapperConfig(lite_bootstrap,free_bootstrapper)FreeConfigIGNORED_STRUCTLOG_ATTRIBUTES(sentry_instrument)logging_factory.STRUCTLOG_META_KEYSAddressProtocol,RequestProtocol,ScopeType(logging_factory,logging_instrument)_AddressProtocol,_RequestProtocoland_ScopeTypethey pointed at had no other use, so they are gone too.not_ready_messageandcheck_dependencieson an instrument, forwarded byBaseInstrument.__init_subclass__not_configured_reason,dependencies_installed_RENAMED_ATTRIBUTESand the__init_subclass__override are deleted. The bootstrapper's ownnot_ready_messageis not part of this and stays.From #318, the alias fields and their
_renamed_fieldsentries:FastAPIConfigprometheus_instrumentator_params,prometheus_instrument_params,prometheus_expose_paramsprometheus_*_additional_paramsFastMcpConfigprometheus_instrumentator_params,prometheus_instrument_paramsprometheus_*_additional_paramsLitestarConfigswagger_extra_paramsswagger_additional_paramsfastapi_/fastmcp_/litestar_logging_middleware_enabledlogging_access_log_enabledCONTEXT.mdloses the sentence saying an instrument written againstnot_ready_messagestill works.Kept
deprecated_module_getattrandBaseConfig._renamed_fieldsstay, with nothing using them. AGENTS.md's versioning rules name them as the way to deprecate a module-level name and a config field, so the next rename in 2.x needs them. Their warning used to say "removed in lite-bootstrap 2.0", which would be wrong for anything deprecated from now on. It now reads the version fromhelpers.warn.NEXT_MAJOR_VERSION = "3.0". If you would rather delete both helpers and rewrite the AGENTS.md rule, that's a small follow-up.Tests
Written first. These failed on main:
test_a_name_deprecated_in_1_x_is_gone, one case per module and name, expectsAttributeError. On main each name warned and resolved.test_a_field_name_deprecated_in_1_x_is_rejected, one case per config and field, expectsTypeError. On main each one forwarded with a warning.The alias-mechanics tests now run against test-only targets: a
deprecated_module_getattrbuilt in the test module, and aRenamingConfigwith one renamed field. They keep the checks from 1.16.0: the warning attribution, setting both names raisingConfigurationError,from_dict,from_objectanddataclasses.replace. The two legacy-instrument tests intest_base_instrument.pyare deleted, as #314 says. The star-import test is gone too: no lite-bootstrap module has a__getattr__any more.The full suite passes, 551 tests at 100% coverage (
just test-ci).just lint(includingty),just adr-checkandjust docs-buildpass too. The two issues' check is to grep for the old names. Underlite_bootstrap/,docs/,benchmarks/,scripts/,README.md,AGENTS.mdandCONTEXT.mdit finds only the bootstrapper's ownnot_ready_messageand Litestar'slitestar.enums.ScopeType.Breaking changes
ImportError, and accessing one as an attribute raisesAttributeError.TypeError.from_dictandfrom_objectdrop unknown keys, so a settings source that still uses an old field name falls back to the default without an error. That is the existingfrom_dictcontract, and Rename the inconsistent escape-hatch and access-log config fields #318 lists it as a 2.0 break.not_ready_messageorcheck_dependenciesgets no warning. Its skip reason becomes empty, and its dependency check returns True, so it is built even when its package is missing.Two follow-ups, not in either issue:
__init_subclass__could raise on the legacy instrument names for one more major instead of ignoring them.from_dictcould reject the removed field names.I haven't done either.