Skip to content
Snippets Groups Projects
Commit f2e013ad authored by Thomas Schneider's avatar Thomas Schneider
Browse files

build: Generate optional dependencies meta groups

parent 945d0db1
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,20 @@ if TYPE_CHECKING:
def pdm_build_initialize(context: Context) -> None:
if not context.target == "sdist":
return
metadata = context.config.metadata
name = metadata["name"]
optdeps = metadata["optional-dependencies"]
groups = dict()
for opt in optdeps:
group = opt.split("-")[0]
if group not in groups:
groups[group] = []
groups[group].append(opt)
for k, v in groups.items():
optdeps[f"all-{k}"] = [f"{name}[{','.join(v)}]"]
optdeps["all"] = [f"{name}[{','.join('all-' + g for g in groups)}]"]
context.config.build_config.includes.append("schilder2000/static/manifest.json")
if "without-npm" not in context.config_settings:
# Assume built webpack is already present otherwise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment