in noxfile.py [0:0]
def select_plugins(session, directory: str) -> List[Plugin]:
"""
Select all plugins that should be tested in this session.
Considers the current Python version and operating systems against the supported ones,
as well as the user plugins selection (via the PLUGINS environment variable).
"""
assert session.python is not None, "Session python version is not specified"
blacklist = [".isort.cfg", "examples"]
plugins = [
{"dir_name": x, "path": x}
for x in sorted(os.listdir(os.path.join(BASE, directory)))
if x not in blacklist
]
ret = []
skipped = []
for plugin in plugins:
if not (plugin["dir_name"] in PLUGINS or PLUGINS == ["ALL"]):
skipped.append(f"Deselecting {plugin['dir_name']}: User request")
continue
setup_py = os.path.join(BASE, directory, plugin["path"], "setup.py")
classifiers = session.run(
"python", setup_py, "--name", "--classifiers", silent=True
).splitlines()
plugin_name = classifiers.pop(0)
plugin_python_versions = get_setup_python_versions(classifiers)
python_supported = session.python in plugin_python_versions
plugin_os_names = get_plugin_os_names(classifiers)
os_supported = get_current_os() in plugin_os_names
if not python_supported:
py_str = ", ".join(plugin_python_versions)
skipped.append(
f"Deselecting {plugin['dir_name']} : Incompatible Python {session.python}. Supports [{py_str}]"
)
continue
# Verify this plugin supports the OS we are testing on, skip otherwise
if not os_supported:
os_str = ", ".join(plugin_os_names)
skipped.append(
f"Deselecting {plugin['dir_name']}: Incompatible OS {get_current_os()}. Supports [{os_str}]"
)
continue
ret.append(
Plugin(
name=plugin_name,
path=plugin["path"],
module="hydra_plugins." + plugin["dir_name"],
)
)
for msg in skipped:
logger.warn(msg)
if len(ret) == 0:
logger.warn("No plugins selected")
return ret