From 86df8ddc60054c44248883de7dc573575dda1825 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 22 Aug 2025 14:02:24 +1100 Subject: [PATCH 1/2] remove slashes and commas from variant names --- conda_smithy/configure_feedstock.py | 3 +++ ...2366-remove-slashes-from-variant-names.rst | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 news/2366-remove-slashes-from-variant-names.rst diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py index bddbdd5bc..2cc82db08 100644 --- a/conda_smithy/configure_feedstock.py +++ b/conda_smithy/configure_feedstock.py @@ -801,6 +801,9 @@ def dump_subspace_config_files(metas, root_path, platform, arch, upload, forge_c f"{platform}_{arch}", package_key(config, top_level_loop_vars, metas[0].config.subdir), ) + # remove slashes that may occur in variant values and thus the filename + config_name = config_name.replace("/", "").replace(",", "") + short_config_name = config_name conf_hash = hashlib.sha256(config_name.encode("utf-8")).hexdigest()[:8] # drone has a limit of 50, see https://github.com/conda-forge/conda-smithy/issues/1188 diff --git a/news/2366-remove-slashes-from-variant-names.rst b/news/2366-remove-slashes-from-variant-names.rst new file mode 100644 index 000000000..183f5fc3b --- /dev/null +++ b/news/2366-remove-slashes-from-variant-names.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Remove slashes from variant file names which caused problems due to being mis-handled as folders. Also remove commas, which can be similarly misinterpreted (#2366). + +**Security:** + +* From a801ab1d27721926b10df0a916e396669fb81511 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 22 Aug 2025 15:07:28 +1100 Subject: [PATCH 2/2] remove expected test failures now that CRM got smarter --- tests/test_lint_recipe.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tests/test_lint_recipe.py b/tests/test_lint_recipe.py index 6b67fc372..4caa5ac22 100644 --- a/tests/test_lint_recipe.py +++ b/tests/test_lint_recipe.py @@ -4030,7 +4030,6 @@ def test_lint_recipe_parses_ok(): def test_lint_recipe_parses_forblock(): with tempfile.TemporaryDirectory() as tmpdir: - # CRM cannot parse this one with open(os.path.join(tmpdir, "meta.yaml"), "w") as f: f.write( textwrap.dedent( @@ -4067,12 +4066,6 @@ def test_lint_recipe_parses_forblock(): hint.startswith("The recipe is not parsable by parser `conda-forge-tick") for hint in hints ), hints - assert any( - hint.startswith( - "The recipe is not parsable by parser `conda-recipe-manager" - ) - for hint in hints - ), hints assert not any( hint.startswith("The recipe is not parsable by parser `conda-souschef") for hint in hints @@ -4159,12 +4152,6 @@ def test_lint_recipe_parses_v1_spacing(): ) for lint in lints ), lints - assert any( - hint.startswith( - "The recipe is not parsable by parser `conda-recipe-manager" - ) - for hint in hints - ), hints assert not any( hint.startswith("The recipe is not parsable by parser `ruamel.yaml") for hint in hints