Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add osx-arm64 to platform checks #965

Merged
merged 5 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,13 @@ def do_not_consider_for_additional_platform(recipe_folder: str, recipe: str, pla
Return True if current native platform are not included in recipe's additional platforms (no need to build).
"""
recipe_obj = _recipe.Recipe.from_file(recipe_folder, recipe)
# On linux-aarch64 env, only build recipe with linux-aarch64 extra_additional_platforms
# On linux-aarch64 or osx-arm64 env, only build recipe with matching extra_additional_platforms
if platform == "linux-aarch64":
if "linux-aarch64" not in recipe_obj.extra_additional_platforms:
return True
if platform == "osx-arm64":
if "osx-arm64" not in recipe_obj.extra_additional_platforms:
return True
return False


Expand Down
6 changes: 5 additions & 1 deletion bioconda_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,8 @@ def native_platform():
return "linux-aarch64"
if sys.platform.startswith("linux"):
return "linux"
if sys.platform.startswith("darwin") and arch == "arm64":
return "osx-arm64"
if sys.platform.startswith("darwin"):
return "osx"
raise ValueError("Running on unsupported platform")
Expand All @@ -1532,11 +1534,13 @@ def platform2subdir(platform):
return 'linux-aarch64'
elif platform == 'osx':
return 'osx-64'
elif platform == 'osx-arm64':
return 'osx-arm64'
elif platform == 'noarch':
return 'noarch'
else:
raise ValueError(
'Unsupported platform: bioconda only supports linux, linux-aarch64, osx and noarch.')
'Unsupported platform: bioconda only supports linux, linux-aarch64, osx, osx-arm64 and noarch.')


def get_versions(self, name):
Expand Down