From 3b1d0caf4d2d4436e60b19d73ac4594ea5bdf769 Mon Sep 17 00:00:00 2001 From: Ezra Brooks Date: Mon, 9 Nov 2026 13:22:37 -0700 Subject: [PATCH 1/2] chore: consolidate YAML handling to Ruamel --- .isort.cfg | 2 +- vinca/generate_gha.py | 17 +++++++++++------ vinca/generate_gitlab.py | 14 +++++--------- vinca/migrate.py | 3 +-- vinca/pipeline.py | 4 ++-- vinca/snapshot.py | 9 ++++++--- vinca/test_generate_gha.py | 24 ++++++++++++------------ vinca/test_mutex_build_number.py | 6 ++++-- vinca/test_snapshot_main.py | 6 ++++-- vinca/utils.py | 20 +++++++++----------- 10 files changed, 55 insertions(+), 50 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index e85cbe2b..28dc7fc7 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,6 +1,6 @@ [settings] line_length=1000 -known_third_party=requests,ruamel,yaml,pytest,rapidfuzz,opensource,colorama,progressbar,progressbar2 +known_third_party=requests,ruamel,pytest,rapidfuzz,opensource,colorama,progressbar,progressbar2 multi_line_output=3 include_trailing_comma=True force_grid_wrap=0 diff --git a/vinca/generate_gha.py b/vinca/generate_gha.py index 861b18c7..ae99fb27 100644 --- a/vinca/generate_gha.py +++ b/vinca/generate_gha.py @@ -1,5 +1,6 @@ import argparse import glob +import io import os import re import sys @@ -9,8 +10,8 @@ from typing import Any import networkx as nx -import yaml from rich import print +from ruamel.yaml import YAML from vinca import config from vinca.main import get_conda_subdir, read_vinca_yaml @@ -22,7 +23,7 @@ get_skip_existing, ) from vinca.utils import ( - NoAliasDumper, + NoAliasRepresenter, add_test_requirements, build_requirement_graph, built_for_distro, @@ -136,7 +137,7 @@ def add_additional_recipes(args: Namespace): additional_recipes = [] for recipe_path in glob.glob(additional_recipes_path + "/**/recipe.yaml"): with open(recipe_path, encoding="utf-8") as recipe: - additional_recipe = yaml.safe_load(recipe) + additional_recipe = YAML(typ="safe").load(recipe) name, version, bnumber = ( additional_recipe["package"]["name"], @@ -182,8 +183,12 @@ def add_additional_recipes(args: Namespace): def dump_for_gha(doc, f) -> None: - s = yaml.dump(doc, sort_keys=False, Dumper=NoAliasDumper) - s = s.replace("'on':", "on:") + yaml = YAML(typ="safe") + yaml.Representer = NoAliasRepresenter + yaml.default_flow_style = False + stream = io.StringIO() + yaml.dump(doc, stream) + s = stream.getvalue().replace("'on':", "on:") with open(f, "w", encoding="utf-8") as fo: fo.write(s) @@ -572,7 +577,7 @@ def main() -> None: # so all its possible requirements order the stages. metas.append( evaluate_target_selectors( - yaml.safe_load(fi.read()), target_platform=args.platform + YAML(typ="safe").load(fi.read()), target_platform=args.platform ) ) diff --git a/vinca/generate_gitlab.py b/vinca/generate_gitlab.py index 88ad9fae..d9185650 100644 --- a/vinca/generate_gitlab.py +++ b/vinca/generate_gitlab.py @@ -4,16 +4,10 @@ from typing import Any import networkx as nx -import yaml +from ruamel.yaml import YAML from vinca.utils import extract_dependency_names -try: - from yaml import CDumper as Dumper - from yaml import CLoader as Loader -except ImportError: - from yaml import Dumper, Loader - # def setup_yaml(): # """ https://stackoverflow.com/a/8661021 """ # represent_dict_order = lambda self, data: self.represent_mapping('tag:yaml.org,2002:map', data.items()) @@ -36,12 +30,14 @@ def main() -> None: + yaml = YAML(typ="safe") + yaml.default_flow_style = False metas = [] for f in glob.glob(os.path.join(sys.argv[1], "*.yaml")): print(f) with open(f, encoding="utf-8") as fi: - metas.append(yaml.load(fi.read(), Loader=Loader)) + metas.append(yaml.load(fi.read())) requirements = {} @@ -103,4 +99,4 @@ def main() -> None: gitlab_template["stages"] = stage_names with open(".gitlab-ci.yml", "w", encoding="utf-8") as fo: - fo.write(yaml.dump(gitlab_template, Dumper=Dumper)) + yaml.dump(gitlab_template, fo) diff --git a/vinca/migrate.py b/vinca/migrate.py index 7ede4b67..d6a0940e 100644 --- a/vinca/migrate.py +++ b/vinca/migrate.py @@ -9,7 +9,6 @@ import networkx as nx import ruamel.yaml -import yaml from vinca import config from vinca.distro import Distro @@ -213,7 +212,7 @@ def main() -> None: mfile = os.path.join(args.dir + "/migration.yaml") with open(mfile, encoding="utf-8") as fi: - migration = yaml.safe_load(fi) + migration = ruamel.yaml.YAML(typ="safe").load(fi) print(migration) create_migration_instructions( args.platform, migration.get("packages", []), args.trigger_branch diff --git a/vinca/pipeline.py b/vinca/pipeline.py index 185b7c13..4820721b 100644 --- a/vinca/pipeline.py +++ b/vinca/pipeline.py @@ -15,7 +15,7 @@ from pathlib import Path from typing import Any -import yaml +from ruamel.yaml import YAML from vinca.utils import get_repodata @@ -152,7 +152,7 @@ def batch_stages( timings = replace(timings, recipes=recipes) with Path(config_path).open(encoding="utf-8") as stream: - vinca_conf = yaml.safe_load(stream) or {} + vinca_conf = YAML(typ="safe").load(stream) or {} build_individually = set( vinca_conf.get("build_in_own_stage") # Accepted for compatibility with configurations written for the Azure generator. diff --git a/vinca/snapshot.py b/vinca/snapshot.py index 278c9cde..5864db8b 100644 --- a/vinca/snapshot.py +++ b/vinca/snapshot.py @@ -1,7 +1,6 @@ import argparse import datetime -import yaml from rosdistro import ( DistributionCache, get_cached_distribution, @@ -10,6 +9,7 @@ get_index_url, ) from rosdistro.loader import load_url +from ruamel.yaml import YAML from .distro import Distro @@ -26,14 +26,15 @@ def load_distribution_cache(distro_name, rosdistro_ref=None) -> DistributionCach reused from the published cache. """ cache_yaml = get_distribution_cache_string(get_index(get_index_url()), distro_name) - cache = DistributionCache(distro_name, yaml.safe_load(cache_yaml)) + yaml = YAML(typ="safe") + cache = DistributionCache(distro_name, yaml.load(cache_yaml)) if not rosdistro_ref: return cache index = get_index(f"{ROSDISTRO_RAW_URL}/{rosdistro_ref}/index-v4.yaml") urls = index.distributions[distro_name]["distribution"] urls = urls if isinstance(urls, list) else [urls] - data = [yaml.safe_load(load_url(url)) for url in urls] + data = [yaml.load(load_url(url)) for url in urls] cache.update_distribution(data) # fetch the package.xml files the update dropped (only changed releases) @@ -159,4 +160,6 @@ def main() -> None: f.write( f"# Snapshot generated by vinca-snapshot on {utc_time} UTC for distro {args.distro}{source}\n" ) + yaml = YAML(typ="safe") + yaml.default_flow_style = False yaml.dump(output, f) diff --git a/vinca/test_generate_gha.py b/vinca/test_generate_gha.py index 09a61e8a..68b72c1b 100644 --- a/vinca/test_generate_gha.py +++ b/vinca/test_generate_gha.py @@ -3,7 +3,7 @@ import sys import pytest -import yaml +from ruamel.yaml import YAML from vinca import config, generate_gha from vinca.generate_gha import ( @@ -14,6 +14,8 @@ get_stage_name, ) +yaml = YAML(typ="safe") + @pytest.fixture(autouse=True) def rolling_distro(): @@ -56,7 +58,7 @@ def test_unix_pipeline_sets_up_pixi(tmp_path): target="linux-64", ) - workflow = pytest.importorskip("yaml").safe_load(outfile.read_text()) + workflow = yaml.load(outfile.read_text()) steps = workflow["jobs"]["stage_0_job_0"]["steps"] assert steps[1]["name"] == "Disable git auto-maintenance" assert "maintenance.auto false" in steps[1]["run"] @@ -114,7 +116,7 @@ def test_win_pipeline_calls_the_repository_build_script(tmp_path, monkeypatch): build_win_pipeline([[["ros2-rclcpp"]]], "buildbranch_win", outfile=outfile) - workflow = pytest.importorskip("yaml").safe_load(outfile.read_text()) + workflow = yaml.load(outfile.read_text()) steps = workflow["jobs"]["stage_0_job_0"]["steps"] assert steps[-1]["run"] == "call .scripts\\build_win.bat" assert steps[-1]["env"]["CURRENT_RECIPES"] == "ros2-rclcpp" @@ -145,7 +147,6 @@ def test_recipe_requirements_are_host_and_run_names(): def test_stages_are_derived_from_the_generated_recipes(tmp_path, monkeypatch): - yaml = pytest.importorskip("yaml") monkeypatch.chdir(tmp_path) (tmp_path / "vinca.yaml").write_text("{}\n") recipes = { @@ -160,7 +161,7 @@ def test_stages_are_derived_from_the_generated_recipes(tmp_path, monkeypatch): "package": {"name": name, "version": "1.0.0"}, "requirements": {"host": deps, "run": deps}, } - (tmp_path / "recipes" / name / "recipe.yaml").write_text(yaml.safe_dump(recipe)) + yaml.dump(recipe, tmp_path / "recipes" / name / "recipe.yaml") # no resolution of the ROS distribution: only the recipes are read monkeypatch.setattr(generate_gha, "load_configuration", lambda: None) monkeypatch.setattr( @@ -172,7 +173,7 @@ def test_stages_are_derived_from_the_generated_recipes(tmp_path, monkeypatch): generate_gha.main() - jobs = yaml.safe_load((tmp_path / "linux.yml").read_text())["jobs"] + jobs = yaml.load((tmp_path / "linux.yml").read_text())["jobs"] assert [job["steps"][-1]["env"]["CURRENT_RECIPES"] for job in jobs.values()] == [ "ros2-a", "ros2-b", @@ -212,7 +213,7 @@ def test_stages_follow_the_requirements_of_the_platform( for name, recipe in recipes.items(): (tmp_path / "recipes" / name).mkdir(parents=True) recipe = {"package": {"name": name, "version": "1.0.0"}, **recipe} - (tmp_path / "recipes" / name / "recipe.yaml").write_text(yaml.safe_dump(recipe)) + yaml.dump(recipe, tmp_path / "recipes" / name / "recipe.yaml") monkeypatch.setattr(generate_gha, "load_configuration", lambda: None) monkeypatch.setattr( sys, @@ -222,7 +223,7 @@ def test_stages_follow_the_requirements_of_the_platform( generate_gha.main() - jobs = yaml.safe_load((tmp_path / outfile).read_text())["jobs"].values() + jobs = yaml.load((tmp_path / outfile).read_text())["jobs"].values() gmock = next( job for job in jobs @@ -236,13 +237,12 @@ def test_only_later_stages_declare_needs(tmp_path, monkeypatch): (tmp_path / ".scripts").mkdir() (tmp_path / ".scripts" / "build_win.bat").write_text("echo build\n") stages = [[["ros2-a"], ["ros2-b"]], [["ros2-c"]]] - yaml = pytest.importorskip("yaml") build_unix_pipeline(stages, "branch", outfile=tmp_path / "linux.yml") build_win_pipeline(stages, "branch", outfile=tmp_path / "win.yml") for outfile in ("linux.yml", "win.yml"): - jobs = yaml.safe_load((tmp_path / outfile).read_text())["jobs"] + jobs = yaml.load((tmp_path / outfile).read_text())["jobs"] # actionlint rejects `needs: []` assert "needs" not in jobs["stage_0_job_0"] assert "needs" not in jobs["stage_0_job_1"] @@ -269,7 +269,7 @@ def test_keep_file_adds_an_artifact_step(tmp_path, monkeypatch): [[["ros-rolling-rclcpp"]]], "buildbranch_linux", outfile=str(outfile) ) - step = yaml.safe_load(outfile.read_text())["jobs"]["stage_0_job_0"]["steps"][-1] + step = yaml.load(outfile.read_text())["jobs"]["stage_0_job_0"]["steps"][-1] assert step["uses"].startswith("actions/upload-artifact@") assert step["if"] == "always()" and step["with"]["path"] == "work/times.jsonl" @@ -284,5 +284,5 @@ def test_no_artifact_step_without_keep_file(tmp_path, monkeypatch): [[["ros-rolling-rclcpp"]]], "buildbranch_linux", outfile=str(outfile) ) - steps = yaml.safe_load(outfile.read_text())["jobs"]["stage_0_job_0"]["steps"] + steps = yaml.load(outfile.read_text())["jobs"]["stage_0_job_0"]["steps"] assert not any("upload-artifact" in step.get("uses", "") for step in steps) diff --git a/vinca/test_mutex_build_number.py b/vinca/test_mutex_build_number.py index 6232e984..f24f6544 100644 --- a/vinca/test_mutex_build_number.py +++ b/vinca/test_mutex_build_number.py @@ -2,12 +2,14 @@ from unittest.mock import Mock -import yaml +from ruamel.yaml import YAML from vinca.main import expected_build_number from vinca.mutex import generate_mutex_package_recipe from vinca.template import write_recipe +yaml = YAML(typ="safe") + def _conf(**extra): conf = { @@ -49,7 +51,7 @@ def test_mutex_recipe_keeps_its_build_number(tmp_path, monkeypatch): distro.name = "lyrical" recipe = generate_mutex_package_recipe(conf, distro) write_recipe({}, [recipe], conf, distro, single_file=False) - meta = yaml.safe_load( + meta = yaml.load( (tmp_path / "recipes" / "ros2-distro-mutex" / "recipe.yaml").read_text() ) assert meta["build"]["number"] == 28 diff --git a/vinca/test_snapshot_main.py b/vinca/test_snapshot_main.py index 93cd6181..f340f850 100644 --- a/vinca/test_snapshot_main.py +++ b/vinca/test_snapshot_main.py @@ -1,9 +1,11 @@ import sys -import yaml +from ruamel.yaml import YAML from vinca import snapshot +yaml = YAML(typ="safe") + class FakeDistro: """Two released packages; the release repository of `gone` was removed.""" @@ -40,7 +42,7 @@ def test_snapshot_skips_package_without_package_xml(tmp_path, monkeypatch, capsy snapshot.main() - written = yaml.safe_load(output.read_text(encoding="utf-8")) + written = yaml.load(output.read_text(encoding="utf-8")) assert set(written) == {"kept"} assert written["kept"]["dependencies"] == ["rclcpp"] assert "Package 'gone' has no package.xml" in capsys.readouterr().out diff --git a/vinca/utils.py b/vinca/utils.py index c1e75176..3a954d2a 100644 --- a/vinca/utils.py +++ b/vinca/utils.py @@ -5,7 +5,7 @@ import networkx as nx import requests -import yaml +from ruamel.yaml.representer import SafeRepresenter class folded_unicode(str): @@ -17,28 +17,26 @@ class literal_unicode(str): def folded_unicode_representer(dumper, data): - return dumper.represent_scalar("tag:yaml.org,2002:str", data, style=">") + return dumper.represent_scalar("tag:yaml.org,2002:str", str(data), style=">") def literal_unicode_representer(dumper, data): - return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|") + return dumper.represent_scalar("tag:yaml.org,2002:str", str(data), style="|") -yaml.add_representer(folded_unicode, folded_unicode_representer) -yaml.add_representer(literal_unicode, literal_unicode_representer) - - -class NoAliasDumper(yaml.SafeDumper): +class NoAliasRepresenter(SafeRepresenter): def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) - - self.add_representer(folded_unicode, folded_unicode_representer) - self.add_representer(literal_unicode, literal_unicode_representer) + self.sort_base_mapping_type_on_output = False def ignore_aliases(self, data) -> bool: return True +NoAliasRepresenter.add_representer(folded_unicode, folded_unicode_representer) +NoAliasRepresenter.add_representer(literal_unicode, literal_unicode_representer) + + def get_repodata(url_or_path, platform=None): if platform: if not url_or_path.endswith("/"): From 4e4ab53e1a47642666d4fc834f47292922507340 Mon Sep 17 00:00:00 2001 From: Ezra Brooks Date: Mon, 9 Nov 2026 13:34:09 -0700 Subject: [PATCH 2/2] chore: upgrade Ruamel to 19.x --- pixi.lock | 192 +++++++++++++++++----------------------------- pyproject.toml | 2 +- vinca/main.py | 2 +- vinca/template.py | 2 +- 4 files changed, 75 insertions(+), 123 deletions(-) diff --git a/pixi.lock b/pixi.lock index 7a510445..9548bfc4 100644 --- a/pixi.lock +++ b/pixi.lock @@ -51,7 +51,6 @@ environments: - conda: https://prefix.dev/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda - conda: https://prefix.dev/conda-forge/linux-64/rattler-build-0.77.0-hf01adef_1.conda - conda: https://prefix.dev/conda-forge/linux-64/readline-8.2-h8c095d6_2.conda - - conda: https://prefix.dev/conda-forge/linux-64/ruamel.yaml-0.17.17-py314h5bd0f2a_4.conda - conda: https://prefix.dev/conda-forge/linux-64/ruamel.yaml.clib-0.2.15-py314hfe1a184_3.conda - conda: https://prefix.dev/conda-forge/linux-64/ruff-0.14.2-ha3a3aed_0.conda - conda: https://prefix.dev/conda-forge/linux-64/tk-8.6.13-noxft_hd72426e_102.conda @@ -92,13 +91,14 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/rich-15.0.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/rosdistro-1.0.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/rospkg-1.6.1-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda - conda: https://prefix.dev/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/tzdata-2025b-h78e105d_0.conda - conda: https://prefix.dev/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda - - conda_source: vinca[dab70734] @ . + - conda_source: vinca[c2d8a98d] @ . osx-64: - conda: https://prefix.dev/conda-forge/noarch/backports.zstd-1.7.0-py314h680f03e_0.conda - conda: https://prefix.dev/conda-forge/noarch/boolean.py-5.0-pyhd8ed1ab_0.conda @@ -134,6 +134,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/rich-15.0.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/rosdistro-1.0.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/rospkg-1.6.1-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda - conda: https://prefix.dev/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda @@ -158,14 +159,13 @@ environments: - conda: https://prefix.dev/conda-forge/osx-64/pyyaml-6.0.3-py314h10d0514_1.conda - conda: https://prefix.dev/conda-forge/osx-64/rattler-build-0.77.0-h9a0f642_1.conda - conda: https://prefix.dev/conda-forge/osx-64/readline-8.2-h7cca4af_2.conda - - conda: https://prefix.dev/conda-forge/osx-64/ruamel.yaml-0.17.17-py314h6482030_4.conda - conda: https://prefix.dev/conda-forge/osx-64/ruamel.yaml.clib-0.2.15-py314h17af80e_3.conda - conda: https://prefix.dev/conda-forge/osx-64/ruff-0.14.2-hba89d1c_0.conda - conda: https://prefix.dev/conda-forge/osx-64/tk-8.6.13-hf689a15_2.conda - conda: https://prefix.dev/conda-forge/osx-64/yaml-0.2.5-had63097_3.conda - conda: https://prefix.dev/conda-forge/osx-64/zstandard-0.25.0-py314h17af80e_3.conda - conda: https://prefix.dev/conda-forge/osx-64/zstd-1.5.7-h8210216_2.conda - - conda_source: vinca[3cfe35e0] @ . + - conda_source: vinca[e0187b5e] @ . osx-arm64: - conda: https://prefix.dev/conda-forge/noarch/backports.zstd-1.7.0-py314h680f03e_0.conda - conda: https://prefix.dev/conda-forge/noarch/boolean.py-5.0-pyhd8ed1ab_0.conda @@ -201,6 +201,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/rich-15.0.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/rosdistro-1.0.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/rospkg-1.6.1-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda - conda: https://prefix.dev/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda @@ -226,14 +227,13 @@ environments: - conda: https://prefix.dev/conda-forge/osx-arm64/pyyaml-6.0.3-py314h6e9b3f0_1.conda - conda: https://prefix.dev/conda-forge/osx-arm64/rattler-build-0.77.0-h2ace698_1.conda - conda: https://prefix.dev/conda-forge/osx-arm64/readline-8.2-h1d1bf99_2.conda - - conda: https://prefix.dev/conda-forge/osx-arm64/ruamel.yaml-0.17.17-py314h0612a62_4.conda - conda: https://prefix.dev/conda-forge/osx-arm64/ruamel.yaml.clib-0.2.15-py314hd98292b_3.conda - conda: https://prefix.dev/conda-forge/osx-arm64/ruff-0.14.2-h492a034_0.conda - conda: https://prefix.dev/conda-forge/osx-arm64/tk-8.6.13-h892fb3f_2.conda - conda: https://prefix.dev/conda-forge/osx-arm64/yaml-0.2.5-h74c22ad_3.conda - conda: https://prefix.dev/conda-forge/osx-arm64/zstandard-0.25.0-py314hd98292b_3.conda - conda: https://prefix.dev/conda-forge/osx-arm64/zstd-1.5.7-h6491c7d_2.conda - - conda_source: vinca[28278d67] @ . + - conda_source: vinca[1c223f3d] @ . win-64: - conda: https://prefix.dev/conda-forge/noarch/backports.zstd-1.7.0-py314h680f03e_0.conda - conda: https://prefix.dev/conda-forge/noarch/boolean.py-5.0-pyhd8ed1ab_0.conda @@ -269,6 +269,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/rich-15.0.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/rosdistro-1.0.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/rospkg-1.6.1-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda - conda: https://prefix.dev/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda @@ -291,7 +292,6 @@ environments: - conda: https://prefix.dev/conda-forge/win-64/python-3.14.0-h4b44e0e_102_cp314.conda - conda: https://prefix.dev/conda-forge/win-64/pyyaml-6.0.3-py314h2359020_1.conda - conda: https://prefix.dev/conda-forge/win-64/rattler-build-0.77.0-he94b42d_1.conda - - conda: https://prefix.dev/conda-forge/win-64/ruamel.yaml-0.17.17-py314h5a2d7ad_4.conda - conda: https://prefix.dev/conda-forge/win-64/ruamel.yaml.clib-0.2.15-py314hc5dbbe4_3.conda - conda: https://prefix.dev/conda-forge/win-64/ruff-0.14.2-h3e3edff_0.conda - conda: https://prefix.dev/conda-forge/win-64/tk-8.6.13-h2c6b04d_2.conda @@ -302,7 +302,7 @@ environments: - conda: https://prefix.dev/conda-forge/win-64/yaml-0.2.5-h6a83c73_3.conda - conda: https://prefix.dev/conda-forge/win-64/zstandard-0.25.0-py314hc5dbbe4_3.conda - conda: https://prefix.dev/conda-forge/win-64/zstd-1.5.7-hbeecb71_2.conda - - conda_source: vinca[5bc921f9] @ . + - conda_source: vinca[bbc4be42] @ . packages: - conda: https://prefix.dev/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726 @@ -904,21 +904,6 @@ packages: - readline >=8.3,<9.0a0 size: 348899 timestamp: 1787033801506 -- conda: https://prefix.dev/conda-forge/linux-64/ruamel.yaml-0.17.17-py314h5bd0f2a_4.conda - sha256: d916260846d379817d9341bef02761737a6b55f7cf256a4a874aea4869461f06 - md5: d824a7249a8f1ce1817c05090338d8ec - depends: - - __glibc >=2.17,<3.0.a0 - - libgcc >=14 - - python >=3.14.0rc2,<3.15.0a0 - - python_abi 3.14.* *_cp314 - - ruamel.yaml.clib >=0.1.2 - - setuptools - license: MIT - license_family: MIT - run_exports: {} - size: 256115 - timestamp: 1757164524523 - conda: https://prefix.dev/conda-forge/linux-64/ruamel.yaml.clib-0.2.15-py314hfe1a184_3.conda sha256: 2e7000a5e1627e4f3aa070e772be4cd1a6d83484f954c4b8e0a53b3e99bf1e88 md5: f86f9c197fa46247e5ccaaccdee18bf3 @@ -1541,6 +1526,18 @@ packages: run_exports: {} size: 31852 timestamp: 1766125246079 +- conda: https://prefix.dev/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda + sha256: b48bebe297a63ae60f52e50be328262e880702db4d9b4e86731473ada459c2a1 + md5: 06ad944772941d5dae1e0d09848d8e49 + depends: + - python >=3.10 + - ruamel.yaml.clib >=0.2.15 + - python + license: MIT + license_family: MIT + run_exports: {} + size: 98448 + timestamp: 1767538149184 - conda: https://prefix.dev/conda-forge/noarch/setuptools-84.0.0-pyh332efcf_0.conda sha256: 9e200ee5f9ff19a4d94e4b51c4856d53dec849f91032f345cf0c6bc3d51a7183 md5: 62ac906f1cd582c6c264c95625cb9d6f @@ -2040,20 +2037,6 @@ packages: - readline >=8.3,<9.0a0 size: 319279 timestamp: 1787034454836 -- conda: https://prefix.dev/conda-forge/osx-64/ruamel.yaml-0.17.17-py314h6482030_4.conda - sha256: 1fc0b29f1203b907235b77cc52553e6a209297d05a052b8acfc61bb83037c3e5 - md5: 7afd27428a330e9d3d50eb442042b77e - depends: - - __osx >=10.13 - - python >=3.14.0rc2,<3.15.0a0 - - python_abi 3.14.* *_cp314 - - ruamel.yaml.clib >=0.1.2 - - setuptools - license: MIT - license_family: MIT - run_exports: {} - size: 256637 - timestamp: 1757164715902 - conda: https://prefix.dev/conda-forge/osx-64/ruamel.yaml.clib-0.2.15-py314h17af80e_3.conda sha256: 76134192e5c82581f8b748832fc0e5394e76079068c4012a53007ab5a551f8e9 md5: ca59f7ecbc51d106dd0a4f5659a93346 @@ -2576,21 +2559,6 @@ packages: - readline >=8.3,<9.0a0 size: 314395 timestamp: 1787033878899 -- conda: https://prefix.dev/conda-forge/osx-arm64/ruamel.yaml-0.17.17-py314h0612a62_4.conda - sha256: 2d2d7d3dcf5ef2c3e543794d2f43b109e7f3affec7c9d0d17370c89de19c9123 - md5: 62176b47946d999e084ccae88b4142e9 - depends: - - __osx >=11.0 - - python >=3.14.0rc2,<3.15.0a0 - - python >=3.14.0rc2,<3.15.0a0 *_cp314 - - python_abi 3.14.* *_cp314 - - ruamel.yaml.clib >=0.1.2 - - setuptools - license: MIT - license_family: MIT - run_exports: {} - size: 255936 - timestamp: 1757164815939 - conda: https://prefix.dev/conda-forge/osx-arm64/ruamel.yaml.clib-0.2.15-py314hd98292b_3.conda sha256: 7fa751851add4a11a7dea048defa9fd7f1997a9fe3838670efda25b744d76ba3 md5: 35cc651ba43a147c0e259ae959619439 @@ -3069,22 +3037,6 @@ packages: run_exports: {} size: 22565961 timestamp: 1792604776870 -- conda: https://prefix.dev/conda-forge/win-64/ruamel.yaml-0.17.17-py314h5a2d7ad_4.conda - sha256: f313c788da41d77b15acd3c096a7c8763de45a93d5e6f47dcc844ac456639063 - md5: 9edc657959c912dd5f74d2dd24d801ad - depends: - - python >=3.14.0rc2,<3.15.0a0 - - python_abi 3.14.* *_cp314 - - ruamel.yaml.clib >=0.1.2 - - setuptools - - ucrt >=10.0.20348.0 - - vc >=14.3,<15 - - vc14_runtime >=14.44.35208 - license: MIT - license_family: MIT - run_exports: {} - size: 251902 - timestamp: 1757164619352 - conda: https://prefix.dev/conda-forge/win-64/ruamel.yaml.clib-0.2.15-py314hc5dbbe4_3.conda sha256: 5c29679b31a28e2a75aca42e14ff0125c50f4402c63bd28d0e390cf75e96f92f md5: 86443a44633c1897d9bec6a099187c2d @@ -3297,14 +3249,14 @@ packages: purls: [] size: 354697 timestamp: 1742433568506 -- conda_source: vinca[28278d67] @ . +- conda_source: vinca[1c223f3d] @ . variants: target_platform: noarch depends: - python >=3.9 - python * - catkin_pkg >=0.4.16 - - ruamel.yaml >=0.16.6,<0.18.0 + - ruamel.yaml >=0.19.1,<0.20.0 - rosdistro >=0.8.0 - empy >=3.3.4,<4.0.0 - requests >=2.24.0 @@ -3344,60 +3296,14 @@ packages: - conda: https://prefix.dev/conda-forge/osx-arm64/tk-8.6.13-hbeba79b_4.conda - conda: https://prefix.dev/conda-forge/osx-arm64/uv-0.12.8-h0e72303_0.conda - conda: https://prefix.dev/conda-forge/osx-arm64/zstd-1.5.7-hf451053_7.conda -- conda_source: vinca[3cfe35e0] @ . +- conda_source: vinca[bbc4be42] @ . variants: target_platform: noarch depends: - python >=3.9 - python * - catkin_pkg >=0.4.16 - - ruamel.yaml >=0.16.6,<0.18.0 - - rosdistro >=0.8.0 - - empy >=3.3.4,<4.0.0 - - requests >=2.24.0 - - networkx >=2.5 - - rich >=10 - - jinja2 >=3.0.0 - - license-expression >=30.0.0 - - packaging >=23.0 - - zstandard >=0.19.0 - license: MIT - host_packages: - - conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda - - conda: https://prefix.dev/conda-forge/noarch/editables-0.6-pyhcf101f3_0.conda - - conda: https://prefix.dev/conda-forge/noarch/hatchling-1.32.0-pyhcf101f3_0.conda - - conda: https://prefix.dev/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda - - conda: https://prefix.dev/conda-forge/noarch/pathspec-1.1.1-pyhd8ed1ab_0.conda - - conda: https://prefix.dev/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda - - conda: https://prefix.dev/conda-forge/noarch/python_abi-3.14-8_cp314.conda - - conda: https://prefix.dev/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda - - conda: https://prefix.dev/conda-forge/noarch/tomlkit-0.15.1-pyhcf101f3_0.conda - - conda: https://prefix.dev/conda-forge/noarch/trove-classifiers-2026.6.1.19-pyhcf101f3_0.conda - - conda: https://prefix.dev/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda - - conda: https://prefix.dev/conda-forge/osx-64/bzip2-1.0.8-h374f1ed_10.conda - - conda: https://prefix.dev/conda-forge/osx-64/libcxx-23.1.0-h19cb2f5_0.conda - - conda: https://prefix.dev/conda-forge/osx-64/libexpat-2.8.1-hcc62823_1.conda - - conda: https://prefix.dev/conda-forge/osx-64/libffi-3.7.0-h6b3a05b_1.conda - - conda: https://prefix.dev/conda-forge/osx-64/liblzma-5.8.3-hbb4bfdb_1.conda - - conda: https://prefix.dev/conda-forge/osx-64/libmpdec-4.0.0-ha1e9b39_2.conda - - conda: https://prefix.dev/conda-forge/osx-64/libpython-3.14.7-hfe304d0_104_cp314.conda - - conda: https://prefix.dev/conda-forge/osx-64/libsqlite-3.53.4-ha5db789_1.conda - - conda: https://prefix.dev/conda-forge/osx-64/libzlib-1.3.2-hbb4bfdb_3.conda - - conda: https://prefix.dev/conda-forge/osx-64/ncurses-6.6-hcc0dc9a_1.conda - - conda: https://prefix.dev/conda-forge/osx-64/openssl-3.6.4-h332eb6d_0.conda - - conda: https://prefix.dev/conda-forge/osx-64/python-3.14.7-hafa0b4b_104_cp314.conda - - conda: https://prefix.dev/conda-forge/osx-64/readline-8.3-h000c2f7_1.conda - - conda: https://prefix.dev/conda-forge/osx-64/tk-8.6.13-ha6c374e_4.conda - - conda: https://prefix.dev/conda-forge/osx-64/uv-0.12.7-h6c1caad_0.conda - - conda: https://prefix.dev/conda-forge/osx-64/zstd-1.5.7-hbc1a06c_7.conda -- conda_source: vinca[5bc921f9] @ . - variants: - target_platform: noarch - depends: - - python >=3.9 - - python * - - catkin_pkg >=0.4.16 - - ruamel.yaml >=0.16.6,<0.18.0 + - ruamel.yaml >=0.19.1,<0.20.0 - rosdistro >=0.8.0 - empy >=3.3.4,<4.0.0 - requests >=2.24.0 @@ -3437,14 +3343,14 @@ packages: - conda: https://prefix.dev/conda-forge/win-64/vc14_runtime-14.51.36247-habf1de7_41.conda - conda: https://prefix.dev/conda-forge/win-64/vcomp14-14.51.36247-habf1de7_41.conda - conda: https://prefix.dev/conda-forge/win-64/zstd-1.5.7-h534d264_7.conda -- conda_source: vinca[dab70734] @ . +- conda_source: vinca[c2d8a98d] @ . variants: target_platform: noarch depends: - python >=3.9 - python * - catkin_pkg >=0.4.16 - - ruamel.yaml >=0.16.6,<0.18.0 + - ruamel.yaml >=0.19.1,<0.20.0 - rosdistro >=0.8.0 - empy >=3.3.4,<4.0.0 - requests >=2.24.0 @@ -3489,3 +3395,49 @@ packages: - conda: https://prefix.dev/conda-forge/noarch/tomlkit-0.15.1-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/trove-classifiers-2026.6.1.19-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda +- conda_source: vinca[e0187b5e] @ . + variants: + target_platform: noarch + depends: + - python >=3.9 + - python * + - catkin_pkg >=0.4.16 + - ruamel.yaml >=0.19.1,<0.20.0 + - rosdistro >=0.8.0 + - empy >=3.3.4,<4.0.0 + - requests >=2.24.0 + - networkx >=2.5 + - rich >=10 + - jinja2 >=3.0.0 + - license-expression >=30.0.0 + - packaging >=23.0 + - zstandard >=0.19.0 + license: MIT + host_packages: + - conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda + - conda: https://prefix.dev/conda-forge/noarch/editables-0.6-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/hatchling-1.32.0-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pathspec-1.1.1-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + - conda: https://prefix.dev/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://prefix.dev/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/tomlkit-0.15.1-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/trove-classifiers-2026.6.1.19-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda + - conda: https://prefix.dev/conda-forge/osx-64/bzip2-1.0.8-h374f1ed_10.conda + - conda: https://prefix.dev/conda-forge/osx-64/libcxx-23.1.0-h19cb2f5_0.conda + - conda: https://prefix.dev/conda-forge/osx-64/libexpat-2.8.1-hcc62823_1.conda + - conda: https://prefix.dev/conda-forge/osx-64/libffi-3.7.0-h6b3a05b_1.conda + - conda: https://prefix.dev/conda-forge/osx-64/liblzma-5.8.3-hbb4bfdb_1.conda + - conda: https://prefix.dev/conda-forge/osx-64/libmpdec-4.0.0-ha1e9b39_2.conda + - conda: https://prefix.dev/conda-forge/osx-64/libpython-3.14.7-hfe304d0_104_cp314.conda + - conda: https://prefix.dev/conda-forge/osx-64/libsqlite-3.53.4-ha5db789_1.conda + - conda: https://prefix.dev/conda-forge/osx-64/libzlib-1.3.2-hbb4bfdb_3.conda + - conda: https://prefix.dev/conda-forge/osx-64/ncurses-6.6-hcc0dc9a_1.conda + - conda: https://prefix.dev/conda-forge/osx-64/openssl-3.6.4-h332eb6d_0.conda + - conda: https://prefix.dev/conda-forge/osx-64/python-3.14.7-hafa0b4b_104_cp314.conda + - conda: https://prefix.dev/conda-forge/osx-64/readline-8.3-h000c2f7_1.conda + - conda: https://prefix.dev/conda-forge/osx-64/tk-8.6.13-ha6c374e_4.conda + - conda: https://prefix.dev/conda-forge/osx-64/uv-0.12.7-h6c1caad_0.conda + - conda: https://prefix.dev/conda-forge/osx-64/zstd-1.5.7-hbc1a06c_7.conda diff --git a/pyproject.toml b/pyproject.toml index 68f03ef7..a68f09b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ dependencies = [ "catkin_pkg >=0.4.16", - "ruamel.yaml >=0.16.6,<0.18.0", + "ruamel.yaml >=0.19.1,<0.20.0", "rosdistro >=0.8.0", "empy >=3.3.4,<4.0.0", "requests >=2.24.0", diff --git a/vinca/main.py b/vinca/main.py index a071eb7f..9bf0f340 100644 --- a/vinca/main.py +++ b/vinca/main.py @@ -505,7 +505,7 @@ def parse_package(pkg, distro: Distro, vinca_conf, path): # parse as yaml text = test.read_text(encoding="utf-8") test_content = evaluate_distro_selectors( - ruamel.yaml.safe_load(text), ros_distro=config.ros_distro + ruamel.yaml.YAML(typ="safe").load(text), ros_distro=config.ros_distro ) recipe["test"] = test_content diff --git a/vinca/template.py b/vinca/template.py index ace10377..8e1e32b9 100644 --- a/vinca/template.py +++ b/vinca/template.py @@ -150,7 +150,7 @@ def write_recipe(source, outputs, vinca_conf, distro, single_file: bool = True) print("Using test: ", test) text = test.read_text(encoding="utf-8") test_content = evaluate_distro_selectors( - yaml.safe_load(text), ros_distro=config.ros_distro + yaml.YAML(typ="safe").load(text), ros_distro=config.ros_distro ) meta["tests"] = list(meta.get("tests") or []) + test_content["tests"]