Skip to content

Spike - Can we use conda list and conda info all the info we need to work with conda #6882

Closed

Description

Can we stop using the environments.txt file?

Currently when we discover interpreter environments we walk through a list of locators. For conda we have CondaEnvService and CondaEnvFileService (in that order). CondaEnvService uses the conda command and CondaEnvFileService uses the .conda/environments.txt file. So this spike boils down to "can be get rid of CondaEnvFileService?"

Getting environments from mini conda does not work

  • This could be a bigger problem. (possible it fails with vanilla installs of latest version of Conda)
    TODO:
  • Need to test current extension on Windows, Mac and Linux.
    • Latest anaconda
    • Latest mini conda
    • Test discovery of conda environments (ensure they are listed in environment list)
  • Try to find a better way e.g. conda run (check upstream on Conda repo for recommendations)

See https://github.com/microsoft/vscode-python/issues/6802 & #6854
This is Conda related.
TODO:

  • We need to identify a better (proper way) to get this working
    (adding paths, etc is a hack and we're trying to get away from such hacks when dealing with Conda).

Activity

  1. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Aug 7, 2019
  2. changed the title [-]Getting environments from mini conda does not work[/-] [+]Spike - Does `conda info` work on a vanilla install of Conda[/+] on Aug 14, 2019
  3. changed the title [-]Spike - Does `conda info` work on a vanilla install of Conda[/-] [+]Spike - Can we use `conda list` and `conda info` all the info we need to work with conda[/+] on Oct 9, 2019
  4. DonJayamanne commented on Oct 22, 2019

    @DonJayamanne
    Author

    Brett Cannon (@brettcannon) Karthik Nadig (@karthiknadig) Sorry, didn't manage to get to this (i.e. didn't investigate)

  5. 6 remaining items

  6. karthiknadig commented on Nov 19, 2019

    @karthiknadig
    Member

    On Windows:

    Running conda info --all --json returns a JSON object that has a envs field. This value matches the contents of the ~/.conda/environments.txt

    environments.txt

    image

    conda info --all --json

    image

  7. DonJayamanne commented on Nov 20, 2019

    @DonJayamanne
    Author

    Running conda info --all --json returns a JSON object that has a envs field. This value matches the contents of the ~/.conda/environments.txt

    Some background info for Karthik Nadig (@karthiknadig).
    Note: In the past conda info didn't return everything (at all).
    Thats why the extension checked both places. Later PTVS too started doing the same thing.

    So the question is, has conda fixed this and can we rely purely on conda info. If so, do this do this based on a version check?

  8. karthiknadig commented on Nov 20, 2019

    @karthiknadig
    Member

    Don Jayamanne (@DonJayamanne) Luciana Abud (@luabud) How far back in terms of anaconda versions are we supporting?

  9. DonJayamanne commented on Nov 20, 2019

    @DonJayamanne
    Author

    back in terms of anaconda versions are we supporting?

    We need to check what versions are used by our users to make this decision.

  10. karthiknadig commented on Nov 20, 2019

    @karthiknadig
    Member

    I looked up to a year back Anaconda3-5.3.0 released on September 27 2018. conda info gets the environments correctly.

  11. brettcannon commented on Nov 20, 2019

    @brettcannon
    Member

    The real trick is the conda version which is updated independently of Anaconda releases. And we have been planning to support at least conda 4.6 and newer due to relying on conda run going forward.

  12. karthiknadig commented on Nov 21, 2019

    @karthiknadig
    Member

    So Anaconda3-5.3.0 uses conda 4.5.11. Since i can get environments on conda 4.5.11 using conda info i think we are are good there.

  13. karthiknadig commented on Nov 26, 2019

    @karthiknadig
    Member

    On linux, tested from latest to Anaconda3-5.3.1 which uses conda 4.4.10. I am able to access environment data using conda list.
    image

    And via conda info:
    image

    If the minimum version we are planning to support is conda 4.6* then I think we can safely get rid of CondaEnvFileService.

  14. locked as resolved and limited conversation to collaborators on Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsdebtCode quality issues

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions