-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Extract environment list code into the common module to allow reuse #658
Conversation
I don't see a strong argument for adding (yet another) sub command to conda. |
It was just a different approach to the existing way. My first instinct to see a list of environments in conda was to type That's not a strong argument, but its the best I've got right now. Depending on how much you guys plan on doing with environments, this could serve as the jumping off point for interacting with them ( |
There are ways to do those things, but they are also buried in subcommands. It would probably be cleaner this way. |
As someone coming to conda from virtualenv+virtualenvwrapper, having a subcommand that's a first class way to interact with envs would make the most sense to me. |
"How do I list all envs?" seems to be a pretty common question. That to me indicates that maybe this should be a little more publicly exposed. |
So basically |
+1 for this direction. I have brought this up before also. It makes sense. |
Just so we're clear, all of these features already exist. They are just buried in subcommands (except for |
I understand. It just seems like a cleaner interface it we group them together. Easy to adopt, understand, use, sell and document. FWIW, I prefer "conda env" over "conda envs" but that may be a minor thing. |
@joelhullcio ya know, I think I do to having typed out |
|
@asmeurer I didn't know that all of those commands already existed. I'm gonna add a subcommand parser to this and add Again, I think it just comes back to what you're coming from. In venv it's all about the environment, so working explicitly with that via a separate command it what makes sense to me. |
I'm not sure about this one, but I think it might exist. (those all require |
Talked with @ilanschnell a bit about this. What I'm going to do is pull the new |
FYI, I've created a conda-env package. It relies on the extraction of This now simply extracts some code to make it more reusable. |
conda envs
command…vs-cmd Conflicts: conda/cli/main_info.py
From the outside, this function only needs to know whether it should be displaying output or not. This allows other code to use this to create list of environments without mocking out an args object.
@ilanschnell @asmeurer -- going through some older code I had written around environments. I'd really like to get this code merged in. It provides the same behavior ( FWIW, this could be further refactored to break apart creating the list of environments and displaying, but that's another step. This works as an incremental step toward a more usable external API. |
if prefix != config.root_dir: | ||
acc.append(prefix) | ||
|
||
print() |
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 shouldn't be run if output=False.
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.
Doh -- good catch.
Sure. This is a pretty innocuous change. |
Output issue with the stray |
Extract environment list code into the common module to allow reuse
Thanks! |
Hi there, thank you for your contribution to Conda! This pull request has been automatically locked since it has not had recent activity after it was closed. Please open a new issue or pull request if needed. |
Was curious more than anything about what it would take to extract this code and create a
conda envs
command in place ofconda info -e
. This maintains the old behavior, but adds a newenvs
sub-command.