Skip to content

Future compat omegaconf yaml loader#870

Merged
rsokl merged 4 commits into
mainfrom
future-compat-omegaconf-yaml-loader
May 18, 2026
Merged

Future compat omegaconf yaml loader#870
rsokl merged 4 commits into
mainfrom
future-compat-omegaconf-yaml-loader

Conversation

@rsokl

@rsokl rsokl commented May 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

rsokl and others added 4 commits May 17, 2026 23:15
OmegaConf PR #1296 ("Limit YAML alias expansion") moved get_yaml_loader
out of omegaconf._utils and into omegaconf._yaml, and the new loader
registers the pathlib._local.* constructors itself. Guard the existing
monkey-patch with hasattr so the import doesn't crash against the new
layout; on new omegaconf the upstream loader already does what this
patch was injecting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Use the existing _compatibility.OMEGACONF_VERSION pattern to express
this as a version-based feature gate rather than a runtime attribute
probe. The new OMEGACONF_EXPOSES_GET_YAML_LOADER_IN_UTILS flag captures
the fact that OmegaConf 2.4.0 (PR #1296) moved get_yaml_loader out of
_utils into _yaml and registers the pathlib._local constructors itself.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OMEGACONF_EXPOSES_GET_YAML_LOADER_IN_UTILS described where the function
lived, which is only the symptom that surfaced this incompatibility.
The semantic content of the gate is whether OmegaConf's yaml loader
itself constructs pathlib._local.* paths, so name it that way:
OMEGACONF_HANDLES_PATHLIB_LOCAL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The `if not OMEGACONF_HANDLES_PATHLIB_LOCAL:` branch only exercises one
side per environment, so coverage flags the unused edge. Matches the
prior-art pattern in third_party/pydantic.py.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rsokl rsokl merged commit 03a0109 into main May 18, 2026
20 checks passed
@stanlrt

stanlrt commented May 20, 2026

Copy link
Copy Markdown

Hey! Any idea when this is planned to get released? No time pressure, it's just to know when we can expect to remove the deps pins in pyproject files (some users use the pre-release flag so we have to be defensive)

@rsokl

rsokl commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Publishing a release candidate right now

@stanlrt

stanlrt commented May 20, 2026

Copy link
Copy Markdown

Wow amazing

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants