1
0
Fork 0
inkscape/share/extensions/docs/poetry-parse.py
Daniel Baumann 02d935e272
Adding upstream version 1.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 23:40:13 +02:00

38 lines
915 B
Python
Executable file

#!/usr/bin/env python3
import sys
root = {}
children = {}
for line in sys.stdin:
line = (
line.rstrip()
.replace("|", " ")
.replace("--", " ")
.replace("`", " ")
.replace("", " ")
.replace("", " ")
.replace("", " ")
.replace("", " ")
)
record = line.strip()
pkg, version, *_ = record.split(" ", 2)
tab = len(line) - len(record)
if tab == 0:
root[pkg] = version
else:
children[pkg] = version
print("# Packages Used Directly\n\nYou must always include these in your package:\n")
for pkg, version in root.items():
print(f" * {pkg} {version}")
print("\n")
print(
"# Packages Used Indirectly\n\nYou may or may not need to include these, depending on if your packaging system automatically pulls in sub-deps:\n"
)
for pkg, version in children.items():
print(f" * {pkg} {version}")