MCPcopy
hub / github.com/mne-tools/mne-python / _get_installer_packages

Function _get_installer_packages

doc/sphinxext/related_software.py:95–113  ·  view source on GitHub ↗

Get the MNE-Python installer package list YAML.

()

Source from the content-addressed store, hash-verified

93
94@_memory.cache(cache_validation_callback=joblib.expires_after(days=7))
95def _get_installer_packages():
96 """Get the MNE-Python installer package list YAML."""
97 with urllib.request.urlopen(
98 "https://raw.githubusercontent.com/mne-tools/mne-installers/main/recipes/mne-python/construct.yaml"
99 ) as url:
100 data = url.read().decode("utf-8")
101 # Parse data for list of names of packages
102 lines = [line.strip() for line in data.splitlines()]
103 start_idx = lines.index("# <<< BEGIN RELATED SOFTWARE LIST >>>") + 1
104 stop_idx = lines.index("# <<< END RELATED SOFTWARE LIST >>>")
105 packages = [
106 # Lines look like
107 # - mne-ari =0.0.0
108 # or similar.
109 line.split()[1]
110 for line in lines[start_idx:stop_idx]
111 if not line.startswith("#")
112 ]
113 return packages
114
115
116@functools.lru_cache

Callers 1

_get_packagesFunction · 0.85

Calls 2

readMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected