Skip to content

Commit 04356bc

Browse files
committed
poetry: Exclude items in dev group for v2 metadata on production arg
This should later be expanded to support any group akin to poetry's --with and --without GROUP args
1 parent 73cc1b9 commit 04356bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

poetry/flatpak-poetry-generator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def get_module_sources(parsed_lockfile: dict, include_devel: bool = True) -> lis
6464
if section == "package":
6565
for package in packages:
6666
category = package.get("category")
67+
groups = package.get("groups", [])
6768
optional = package.get("optional", False)
6869
if (
6970
not category
@@ -88,6 +89,8 @@ def get_module_sources(parsed_lockfile: dict, include_devel: bool = True) -> lis
8889
hashes.append(match.group(2))
8990
# metadata format 2.0
9091
else:
92+
if groups == ["dev"] and not include_devel:
93+
continue
9194
for file in package["files"]:
9295
match = hash_re.search(file["hash"])
9396
if match:
@@ -119,7 +122,10 @@ def get_dep_names(parsed_lockfile: dict, include_devel: bool = True) -> list:
119122
if section == "package":
120123
for package in packages:
121124
category = package.get("category")
125+
groups = package.get("groups", [])
122126
optional = package.get("optional", False)
127+
if groups == ["dev"] and not include_devel:
128+
continue
123129
if (
124130
not category
125131
or (category == "dev" and include_devel and not optional)

0 commit comments

Comments
 (0)