From 60260f8ae6447176b6bb478cd01d38cf30e69cdb Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 30 Jan 2025 22:23:32 -0600 Subject: [PATCH] feat: remove anchors --- conda_forge_tick/recipe_parser/_parser.py | 1 + tests/test_round_trip.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conda_forge_tick/recipe_parser/_parser.py b/conda_forge_tick/recipe_parser/_parser.py index c21fefed6..ac60122a5 100644 --- a/conda_forge_tick/recipe_parser/_parser.py +++ b/conda_forge_tick/recipe_parser/_parser.py @@ -54,6 +54,7 @@ def _get_yaml_parser(typ="jinja2"): parser.indent(mapping=2, sequence=4, offset=2) parser.width = 320 parser.preserve_quotes = True + parser.representer.ignore_aliases = lambda x: True return parser diff --git a/tests/test_round_trip.py b/tests/test_round_trip.py index 2f9cb01cc..98a78f126 100644 --- a/tests/test_round_trip.py +++ b/tests/test_round_trip.py @@ -5,15 +5,19 @@ def test_round_trip_v0(): myaml = """\ -blah: # [unix] +blah: &foo # [unix] - blah # [osx] - foo +foo: *foo """ fmyaml = """\ blah: # [unix] - blah # [osx] - foo +foo: + - blah # [osx] + - foo """ with tempfile.TemporaryDirectory() as d: