Skip to content

Commit

Permalink
more detailed instructions (#2071)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen authored Oct 1, 2024
1 parent cd15146 commit 18b0038
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions metaflow/plugins/pypi/micromamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,27 @@ def _call(self, args, env=None):
# raise a specific error message for virtual package related errors
match = next((p for p in v_pkgs if p in error), None)
if match is not None:
raise MicromambaException(
[
error,
"Please set the environment variable CONDA_OVERRIDE_%s to a specific version"
% (match[2:].upper()),
vpkg_name = match[2:]
# try to strip version from error msg which are of the format:
# nothing provides <__vpkg> >=2.17,<3.0.a0 needed by <pkg_name>
try:
vpkg_version = error[
len("nothing provides %s " % match) : error.index(
" needed by"
)
]
except ValueError:
vpkg_version = None
raise MicromambaException(
"Please set the environment variable CONDA_OVERRIDE_{var} to a specific version{version} of {name}.\n"
"Here is an example of supplying environment variables through the command line -\n\n"
"CONDA_OVERRIDE_{var}=<{name}-version> python flow.py <args>".format(
var=vpkg_name.upper(),
version=(
"" if not vpkg_version else (" (%s)" % vpkg_version)
),
name=vpkg_name,
),
)
err.append(error)
raise MicromambaException(
Expand Down

0 comments on commit 18b0038

Please sign in to comment.