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

MAINT: Sync mne-feedstock and pyproject.toml #12919

Open
larsoner opened this issue Oct 24, 2024 · 2 comments
Open

MAINT: Sync mne-feedstock and pyproject.toml #12919

larsoner opened this issue Oct 24, 2024 · 2 comments

Comments

@larsoner
Copy link
Member

larsoner commented Oct 24, 2024

... and if we want to be really complete, we should also make the conda-forge recipe for mne-base 100% consistent with the minimal reqs in pyproject.toml and mne at least more consistent with mne[full] as well:

https://github.com/conda-forge/mne-feedstock/blob/ac4cd905e3e5ac5e667fd707dfff498a60ade511/recipe/meta.yaml#L27-L112

Originally posted by @larsoner in #12903 (comment)

@larsoner
Copy link
Member Author

Just to add I don't think we need to hit 100% synchronization between mne[full] and the mne recipe, but we should at least know what the differences are. Since we don't want to fetch the recipe on every commit, a pre-commit hook is probably not the best candidate here. Instead a unit test could be used, or our style CI runs could have a new "consistency" entry or something.

@drammock
Copy link
Member

some WIP code for this, not really far enough along to open a PR yet but at least here's a start:

from collections import defaultdict
from urllib.request import urlopen

import yaml

content= urlopen(
    "https://raw.githubusercontent.com/conda-forge/mne-feedstock/main/recipe/meta.yaml"
).read().decode("utf-8").split("\n")

# file contains Jinja stuff that chokes the YAML parser, so just pull out what we need
depth = 0
output = defaultdict(list)
for line in content:
    line = line.strip()
    if line.startswith("- name: mne-installer-menus"):
        break
    if line.startswith("test:"):
        depth = 1
    if line.startswith("- name:"):
        key = line.split(": ")[1]
    for level in ("outputs", "requirements", "run"):
        if line.startswith(f"{level}:"):
            depth += 1
    if depth == 3 and "{{ pin_subpackage" not in line:
        output[key].append(line)
# TODO: meaningful comments aren't parsed, so lines like
# - pyqt  # [build_variant == "pyqt"]
# - pyside6  # [build_variant == "pyside6"]
# aren't handled well

deps_mne_base = yaml.safe_load("\n".join(output["mne-base"]))["run"]
deps_mne = yaml.safe_load("\n".join(output["mne"]))["run"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants