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

Alias conda env list command to conda info --envs #13972

Merged
merged 10 commits into from
Jul 4, 2024

Conversation

beeankha
Copy link
Contributor

@beeankha beeankha commented Jun 11, 2024

This PR targets Step 2 (removing duplicate subcommands) of the "refactoring and deprecating conda env-related commands and modules" epic. Specifically, this PR aliases the conda env list command to conda info --envs; this means that even though the execution of the command is mostly reliant on main_info.py, anyone who uses/prefers the older conda env list command will still be able to get the output that they expect.

Depends on: #14004

@beeankha beeankha self-assigned this Jun 11, 2024
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jun 11, 2024
@beeankha beeankha added source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt and removed cla-signed [bot] added once the contributor has signed the CLA labels Jun 11, 2024
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jun 11, 2024
Copy link

codspeed-hq bot commented Jun 11, 2024

CodSpeed Performance Report

Merging #13972 will not alter performance

Comparing beeankha:alias_conda_env_list (8c09b71) with main (2a06833)

Summary

✅ 21 untouched benchmarks

@beeankha beeankha marked this pull request as ready for review June 11, 2024 19:03
@beeankha beeankha requested a review from a team as a code owner June 11, 2024 19:03
@beeankha beeankha mentioned this pull request Jun 12, 2024
16 tasks
Copy link
Contributor

@travishathaway travishathaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I noticed about this change is that it changes the output of conda env list -v.

Before

# conda environments:
#

base                  *  /Users/username/opt/conda
conda-reporters          /Users/username/opt/conda/envs/conda-reporters
pypi                     /Users/username/opt/conda/envs/pypi
tester                   /Users/username/opt/conda/envs/tester

After


     active environment : base
    active env location : /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c
            shell level : 1
       user config file : /Users/username/.condarc
 populated config files : /Users/username/.condarc
          conda version : 24.5.1.dev48+gb9556ffe7
    conda-build version : 24.5.0
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.5.1.dev48+gb9556ffe7=0
                          __osx=14.4.1=0
                          __unix=0=0
       base environment : /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c  (writable)
      conda av data dir : /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/pkgs
                          /Users/username/.conda/pkgs
       envs directories : /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/envs
                          /Users/username/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.5.1.dev48+gb9556ffe7 requests/2.32.2 CPython/3.10.14 Darwin/23.4.0 OSX/14.4.1 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8 aau/0.4.4
                UID:GID : 501:20
             netrc file : None
           offline mode : False


# conda environments:
#

base                  *  /Users/username/opt/conda
conda-reporters          /Users/username/opt/conda/envs/conda-reporters
pypi                     /Users/username/opt/conda/envs/pypi
tester                   /Users/username/opt/conda/envs/tester


sys.version: 3.10.14 (main, May  6 2024, 14:42:37) [C...
sys.prefix: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c
sys.executable: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/python
conda location: /Users/username/dev/conda/conda
conda-build: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-build
conda-content-trust: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-content-trust
conda-convert: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-convert
conda-debug: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-debug
conda-develop: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-develop
conda-env: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-env
conda-inspect: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-inspect
conda-metapackage: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-metapackage
conda-render: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-render
conda-server: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-server
conda-skeleton: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda-skeleton
user site dirs: ~/.local/lib/python3.11
                ~/.local/lib/python3.12

CIO_TEST: <not set>
CONDA_ALLOW_SOFTLINKS: false
CONDA_DEFAULT_ENV: base
CONDA_EXE: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/conda
CONDA_PREFIX: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c
CONDA_PROMPT_MODIFIER: (base)
CONDA_PYTHON_EXE: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/bin/python
CONDA_ROOT: /Users/username/dev/conda/devenv/Darwin/arm64/envs/devenv-3.10-c
CONDA_SHLVL: 1
CURL_CA_BUNDLE: <not set>
LD_PRELOAD: <not set>
PATH: /usr/bin:/bin:/usr/sbin:/sbin
PYTHONPATH: /Users/username/dev/conda:
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>

This might be a problem for scripts that parse the output. Is there anyway we could preserve the old output?

@beeankha
Copy link
Contributor Author

Per @travishathaway 's comment, it appears that the --all flag being deprecated in favor of verbosity level does not make sense for the conda env list / conda info --envs commands. PR #14004 reverts that deprecation and will result in identical output for the non-aliased conda env list -v command as what is output for conda info --envs -v once it is merged.

@travishathaway
Copy link
Contributor

I found a problem with the pull request after updating from main after merging #14004. I fixed it with the latest commit.

Copy link
Contributor

@travishathaway travishathaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passing. Looks good.

@travishathaway travishathaway merged commit 3ae5d7c into conda:main Jul 4, 2024
66 checks passed
@kenodegard kenodegard mentioned this pull request Jul 17, 2024
61 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants