Skip to content

Conversation

@AlbertDeFusco
Copy link
Contributor

@AlbertDeFusco AlbertDeFusco commented Apr 25, 2021

This adds a --dry-run flag to conda env create that creates YAML or JSON output of the solved environment without installing it.

Question: Without --json but with --quiet this will still display the spinner. Would another PR to more easily quiet the spinner be appreciated just by using --quiet?

By using the CONDA_SUBDIR environment variable this flag can also be used to check environment solves cross platform.

YAML

Here's an example

conda env create --dry-run defusco/py376
Collecting package metadata (repodata.json): done
Solving environment: done
name: py376
channels:
  - defaults
dependencies:
  - defaults/osx-64::ca-certificates==2021.1.19=hecd8cb5_1
  - defaults/osx-64::libcxx==10.0.0=1
  - defaults/osx-64::xz==5.2.5=h1de35cc_0
  - defaults/osx-64::yaml==0.1.7=hc338f04_2
  - defaults/osx-64::zlib==1.2.11=h1de35cc_3
  - defaults/osx-64::libffi==3.2.1=h0a44026_1007
  - defaults/osx-64::ncurses==6.2=h0a44026_1
  - defaults/osx-64::openssl==1.1.1g=h1de35cc_0
  - defaults/osx-64::tk==8.6.10=hb0a8c7a_0
  - defaults/osx-64::libedit==3.1.20191231=h1de35cc_1
  - defaults/osx-64::readline==7.0=h1de35cc_5
  - defaults/osx-64::sqlite==3.33.0=hffcf06c_0
  - defaults/osx-64::python==3.7.6=h359304d_2
  - defaults/osx-64::certifi==2020.12.5=py37hecd8cb5_0
  - defaults/osx-64::pyyaml==5.3.1=py37h1de35cc_0
  - defaults/osx-64::rope==0.10.7=py37_0
  - defaults/noarch::wheel==0.36.2=pyhd3eb1b0_0
  - defaults/osx-64::setuptools==52.0.0=py37hecd8cb5_0
  - defaults/osx-64::pip==20.3.3=py37hecd8cb5_0

JSON

>conda env create --dry-run --json defusco/py376
{
  "name": "py376",
  "channels": [
    "defaults"
  ],
  "dependencies": [
    "defaults/osx-64::ca-certificates==2021.1.19=hecd8cb5_1",
    "defaults/osx-64::libcxx==10.0.0=1",
    "defaults/osx-64::xz==5.2.5=h1de35cc_0",
    "defaults/osx-64::yaml==0.1.7=hc338f04_2",
    "defaults/osx-64::zlib==1.2.11=h1de35cc_3",
    "defaults/osx-64::libffi==3.2.1=h0a44026_1007",
    "defaults/osx-64::ncurses==6.2=h0a44026_1",
    "defaults/osx-64::openssl==1.1.1g=h1de35cc_0",
    "defaults/osx-64::tk==8.6.10=hb0a8c7a_0",
    "defaults/osx-64::libedit==3.1.20191231=h1de35cc_1",
    "defaults/osx-64::readline==7.0=h1de35cc_5",
    "defaults/osx-64::sqlite==3.33.0=hffcf06c_0",
    "defaults/osx-64::python==3.7.6=h359304d_2",
    "defaults/osx-64::certifi==2020.12.5=py37hecd8cb5_0",
    "defaults/osx-64::pyyaml==5.3.1=py37h1de35cc_0",
    "defaults/osx-64::rope==0.10.7=py37_0",
    "defaults/noarch::wheel==0.36.2=pyhd3eb1b0_0",
    "defaults/osx-64::setuptools==52.0.0=py37hecd8cb5_0",
    "defaults/osx-64::pip==20.3.3=py37hecd8cb5_0"
  ]
}

with the --dry-run flag a solved
environment is printed in YAML
format or JSON with the --json
flag
@AlbertDeFusco AlbertDeFusco requested a review from a team as a code owner April 25, 2021 23:27
@anaconda-issue-bot anaconda-issue-bot added the cla-signed [bot] added once the contributor has signed the CLA label Apr 25, 2021
@chenghlee chenghlee added this to the 4.10.2 milestone Apr 26, 2021
@chenghlee chenghlee merged commit f47dc5e into conda:master May 24, 2021
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jun 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants