Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ The current members of the MkDocs-NG team.

* [@shenxianpeng](https://github.com/shenxianpeng)

## Version 1.7.1 (Unreleased)

### Maintenance

* Remove the unmaintained `mergedeep` dependency by replacing it with an internal deep-merge helper for inherited YAML configuration. #29

## Version 1.7.0 (2026-04-24)

MkDocs NG 1.7.0 is a small but important release. The biggest change is that
Expand Down
9 changes: 9 additions & 0 deletions mkdocs/tests/utils/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
baz:
sub1: replaced
sub3: new
replace_list:
- child
replace_scalar:
nested: value
deep1:
deep2-1:
deep3-1: replaced
Expand All @@ -28,6 +32,9 @@
baz:
sub1: 1
sub2: 2
replace_list:
- parent
replace_scalar: value
deep1:
deep2-1:
deep3-1: foo
Expand Down Expand Up @@ -291,6 +298,8 @@ def test_yaml_inheritance(self, tdir):
"sub2": 2,
"sub3": "new",
},
"replace_list": ["child"],
"replace_scalar": {"nested": "value"},
"deep1": {
"deep2-1": {
"deep3-1": "replaced",
Expand Down
18 changes: 16 additions & 2 deletions mkdocs/utils/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import logging
import os
import os.path
from collections.abc import MutableMapping
from typing import IO, TYPE_CHECKING, Any

import mergedeep # type: ignore
import yaml
import yaml.constructor
import yaml_env_tag # type: ignore
Expand All @@ -19,6 +19,20 @@
log = logging.getLogger(__name__)


def _deep_merge(
parent: MutableMapping[Any, Any], child: MutableMapping[Any, Any]
) -> MutableMapping[Any, Any]:
for key, child_value in child.items():
parent_value = parent.get(key)
if isinstance(parent_value, MutableMapping) and isinstance(
child_value, MutableMapping
):
_deep_merge(parent_value, child_value)
else:
parent[key] = child_value
return parent


def _construct_dir_placeholder(
config: MkDocsConfig, loader: yaml.BaseLoader, node: yaml.ScalarNode
) -> _DirPlaceholder:
Expand Down Expand Up @@ -152,5 +166,5 @@ def yaml_load(
log.debug(f"Loading inherited configuration file: {abspath}")
with open(abspath, "rb") as fd:
parent = yaml_load(fd, loader)
result = mergedeep.merge(parent, result)
result = _deep_merge(parent, result)
return result
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ dependencies = [
"pyyaml_env_tag >=0.1",
"importlib-metadata >=4.4; python_version < '3.10'",
"packaging >=20.5",
"mergedeep >=1.3.4",
"pathspec >=0.11.1",
"mkdocs-get-deps >=0.2.0",
"colorama >=0.4; platform_system == 'Windows'",
Expand All @@ -66,7 +65,6 @@ min-versions = [
"pyyaml_env_tag ==1.1",
"importlib-metadata ==4.4; python_version < '3.10'",
"packaging ==26.1",
"mergedeep ==1.3.4",
"pathspec ==1.0.4",
"mkdocs-get-deps ==0.2.2",
"colorama ==0.4.6; platform_system == 'Windows'",
Expand Down
Loading