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
3 changes: 3 additions & 0 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions news/2366-remove-slashes-from-variant-names.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**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:**

* <news item>
13 changes: 0 additions & 13 deletions tests/test_lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

@h-vetinari h-vetinari Aug 27, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schuylermartin45, this test (just unfold below) started not triggering the hint "The recipe is not parsable by parser conda-recipe-manager" anymore. Not sure what conda-smithy does internally there, perhaps just something changed w.r.t. what smithy expects CRM to do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see it/understand now. Let me take a look. We did not intentionally add support for the JINJA for loop syntax, so this is surprising.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @h-vetinari. This is indeed why I started looking at this more carefully.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the reasons I wanted to keep the commits separate is that now you can just revert a801ab1 on top of main, and go from there. :)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through the release tags and this difference is a few months old. CRM v0.5.1 is the last version to throw-on-parse, CRM v0.6.0 (released in June) is the first to not throw.

@schuylermartin45 schuylermartin45 Aug 27, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking: conda/conda-recipe-manager#430

This is a little nuanced. I'm guessing this change is a consequence of our efforts to improve parsing compatibility. So to re-introduce this exception on purpose feels weird to me.

At the same time, I understand the reasoning why we should. We don't "support" editing or manipulating or rendering such loops.

One could argue the CRM CLI command crm bump-recipe is improved by ignoring this support gap (because a recipe can still be bumped to a new version) and crm convert should at least warn the user about the unsupported syntax.

There is a function I've left unimplemented for a long time, just in case we ever needed it: RecipeReader::has_unsupported_statements(). Maybe it is time to circle back on that idea.

with open(os.path.join(tmpdir, "meta.yaml"), "w") as f:
f.write(
textwrap.dedent(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down