From 5a2bdde1e4ffe32b1ea9325b1dd05d7c2e86b8d5 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Thu, 30 Mar 2023 12:17:55 +0100 Subject: [PATCH] create_dev_env ignore linux only requirements on not linux Work around https://github.com/conda/conda/issues/8089 Only handle this case, as a more general solution is not needed --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 48c441da52a..0a2e791da78 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ import fnmatch import os +import platform import subprocess from distutils.core import Command import sys @@ -174,7 +175,7 @@ def count_indent(self, line): return leading_spaces // 2 def get_package_depends(self): - # Parse the metefile manually, do avoid needing an nonstandard library + # Parse the metafile manually, do avoid needing a nonstandard library meta_file = Path(__file__).parent / "conda" / "meta.yaml" with meta_file.open() as meta_file_fh: section = [] @@ -183,6 +184,8 @@ def get_package_depends(self): # ignore templating if line.strip() == "" or "{%" in line: continue + if platform.system() != "Linux" and "[linux]" in line: + continue if line.strip().endswith(":"): indent = self.count_indent(line) section = section[:indent]