Skip to content

Commit

Permalink
do not test __osx and __glibc twice
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Nov 8, 2024
1 parent 62e3f48 commit 3419a50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion constructor/osxpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ def move_script(src, dst, info, ensure_shebang=False, user_script_type=None):
path_exists_error_text = info.get(
"install_path_exists_error_text", default_path_exists_error_text
).format(CHOSEN_PATH=f"$2/{pkg_name_lower}")
# __osx is tested by the PKG metadata directly, no need to repeat
virtual_specs = [spec for spec in info.get("virtual_specs", ()) if "__osx" not in spec]
replace = {
'NAME': info['name'],
'NAME_LOWER': pkg_name_lower,
Expand All @@ -344,7 +346,7 @@ def move_script(src, dst, info, ensure_shebang=False, user_script_type=None):
'SHORTCUTS': shortcuts_flags(info),
'ENABLE_SHORTCUTS': str(info['_enable_shortcuts']).lower(),
'REGISTER_ENVS': str(info.get("register_envs", True)).lower(),
'VIRTUAL_SPECS': shlex.join(info.get("virtual_specs", ())),
'VIRTUAL_SPECS': shlex.join(virtual_specs),
}
data = preprocess(data, ppd)
custom_variables = info.get('script_env_variables', {})
Expand Down
8 changes: 7 additions & 1 deletion constructor/shar.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def get_header(conda_exec, tarball, info):
ppd['enable_shortcuts'] = str(info['_enable_shortcuts']).lower()
ppd['check_path_spaces'] = info.get("check_path_spaces", True)
install_lines = list(add_condarc(info))
# Omit __osx and __glibc because those are tested with shell code direcly
virtual_specs = [
spec
for spec in info.get("virtual_specs", ())
if "__osx" not in spec and "__glibc" not in spec
]
# Needs to happen first -- can be templated
replace = {
'CONSTRUCTOR_VERSION': info['CONSTRUCTOR_VERSION'],
Expand All @@ -94,7 +100,7 @@ def get_header(conda_exec, tarball, info):
'SHORTCUTS': shortcuts_flags(info),
'REGISTER_ENVS': str(info.get("register_envs", True)).lower(),
'TOTAL_INSTALLATION_SIZE_KB': str(approx_size_kb(info, "total")),
'VIRTUAL_SPECS': shlex.join(info.get("virtual_specs", ()))
'VIRTUAL_SPECS': shlex.join(virtual_specs)
}
if has_license:
replace['LICENSE'] = read_ascii_only(info['license_file'])
Expand Down

0 comments on commit 3419a50

Please sign in to comment.