-
Notifications
You must be signed in to change notification settings - Fork 754
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
conda list and clean commands #1803
base: master
Are you sure you want to change the base?
Conversation
LGTM.. just not sure how easy or hard it is to add tests. |
haven't looked yet in detail but I think we should name it |
@romain-intel, this is more of a hidden utility to clean out the underlying conda environments than providing a top-level environment manipulation command. there is a good reason that we may want to have |
I mean, it would be exposed to the user and there is similarity with this: https://github.com/Netflix/metaflow-nflx-extensions/blob/main/metaflow_extensions/netflix_ext/plugins/environment_cli.py so I wanted to try to minimize (more) divergence. There is also an argument for doing this in |
I remember asking @savingoyal if we wanna add this at the At the |
Totally agree that it doesn't necessarily have to be at the |
metaflow/plugins/pypi/conda_cli.py
Outdated
manifest_path = os.path.join( | ||
ctx.obj.flow_datastore.datastore_root, ctx.obj.flow.name, MAGIC_FILE | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same problem as with list_envs. Not getting any environments when default datastore is not local.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, can you check again please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is still bugging out, though cause is my messy conda manifest:
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
@conda.command(name="list", help="List conda environments for a flow.") | ||
@click.option( | ||
"-a", | ||
"--show-all", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting an error with --show-all
with my local manifest:
print("{:<18} {:<67} {:<8} {:<12} {:<12}".format(row))
TypeError: unsupported format string passed to NoneType.__format__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you help me with debugging this...
to start with, what is the value of row
?
also, what are the values of item
, envs_data
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared my conda manifest for testing purposes. The failing row for displaying is this:
['6bf4a51d2573ea3', None, '', 'osx-32', 'conda']
which most likely is leftovers from my development with the PyPI deco.
MAGIC_FILE, | ||
) | ||
if not os.path.exists(manifest_path): | ||
print(f"No conda environments for the flow: {ctx.obj.flow.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string borking python 3.5 tests. Note the other occurrences as well.
@conda.command(name="list", help="List conda environments for a flow.") | ||
@click.option( | ||
"-a", | ||
"--show-all", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared my conda manifest for testing purposes. The failing row for displaying is this:
['6bf4a51d2573ea3', None, '', 'osx-32', 'conda']
which most likely is leftovers from my development with the PyPI deco.
TODOs: