Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MatchSpec parsing when remote_ci_setup specs are quoted #1775

Merged
merged 6 commits into from
Sep 26, 2023
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: 2 additions & 1 deletion conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,8 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None):
config["remote_ci_setup"]
)
config["remote_ci_setup_names"] = [
MatchSpec(pkg).name for pkg in config["remote_ci_setup"]
MatchSpec(pkg.strip('"').strip("'")).name
for pkg in config["remote_ci_setup"]
]

# Older conda-smithy versions supported this with only one
Expand Down
23 changes: 23 additions & 0 deletions news/1775-quotes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Fix ``MatchSpec`` parsing when ``remote_ci_setup`` specs are quoted. (#1773 via #1775)

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
19 changes: 19 additions & 0 deletions tests/test_configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,3 +907,22 @@ def test_conda_build_tools(config_yaml):

with pytest.raises(AssertionError):
assert load_forge_config()


def test_remote_ci_setup(config_yaml):
load_forge_config = lambda: cnfgr_fdstk._load_forge_config( # noqa
config_yaml,
exclusive_config_file=os.path.join(
config_yaml, "recipe", "default_config.yaml"
),
)
cfg = load_forge_config()
with open(os.path.join(config_yaml, "conda-forge.yml"), "a+") as fp:
fp.write("remote_ci_setup: ['conda-forge-ci-setup=3', 'py-lief<0.12']")
cfg = load_forge_config()
# pylief was quoted due to <
assert cfg["remote_ci_setup"] == [
"conda-forge-ci-setup=3",
'"py-lief<0.12"',
beckermr marked this conversation as resolved.
Show resolved Hide resolved
]
assert cfg["remote_ci_setup_names"] == ["conda-forge-ci-setup", "py-lief"]