Skip to content

Commit 9f7323a

Browse files
committed
pip: Handle platform_system marker
1 parent e39e586 commit 9f7323a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pip/flatpak-pip-generator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,17 @@ def handle_sys_platform(marker: str) -> bool:
756756
return False
757757
return True
758758

759+
def handle_platform_system(marker: str) -> bool:
760+
pattern = r'platform_system\s*(==|!=)\s*["\']([^"\']+)["\']'
761+
762+
for match in re.finditer(pattern, marker, re.IGNORECASE):
763+
op, system = match.group(1), match.group(2).lower()
764+
if (op == "==" and system != "linux") or (
765+
op == "!=" and system == "linux"
766+
):
767+
return False
768+
return True
769+
759770
def handle_os_name(marker: str) -> bool:
760771
pattern = r'os_name\s*(==|!=)\s*["\']([^"\']+)["\']'
761772

@@ -861,6 +872,7 @@ def to_ver(v: str) -> Version | None:
861872

862873
marker_handlers = (
863874
handle_sys_platform,
875+
handle_platform_system,
864876
handle_os_name,
865877
handle_implementation_name,
866878
handle_platform_machine,

0 commit comments

Comments
 (0)