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

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

Closed
4 tasks
DonJayamanne opened this issue Aug 7, 2019 · 9 comments
Closed
4 tasks
Assignees
Labels
area-environments Features relating to handling interpreter environments debt Covers everything internal: CI, testing, refactoring of the codebase, etc.

Comments

@DonJayamanne
Copy link

DonJayamanne commented Aug 7, 2019

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).
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug triage triage-needed Needs assignment to the proper sub-team labels Aug 7, 2019
@DonJayamanne DonJayamanne self-assigned this Aug 7, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Aug 7, 2019
@DonJayamanne DonJayamanne mentioned this issue Aug 7, 2019
24 tasks
@DonJayamanne DonJayamanne changed the title Getting environments from mini conda does not work Spike - Does conda info work on a vanilla install of Conda Aug 14, 2019
@DonJayamanne DonJayamanne removed their assignment Aug 14, 2019
@DonJayamanne DonJayamanne added this to the 2019 - August Sprint 16 milestone Aug 14, 2019
@DonJayamanne DonJayamanne added the debt Covers everything internal: CI, testing, refactoring of the codebase, etc. label Aug 14, 2019
@ericsnowcurrently ericsnowcurrently removed this from the 2019 - August Sprint 16 milestone Sep 16, 2019
@karthiknadig karthiknadig 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 Oct 9, 2019
@karthiknadig karthiknadig added this to the 2019 October Sprint 2 milestone Oct 9, 2019
@DonJayamanne
Copy link
Author

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

@brettcannon brettcannon added area-environments Features relating to handling interpreter environments and removed bug Issue identified by VS Code Team member as probable bug labels Oct 23, 2019
@karthiknadig karthiknadig self-assigned this Nov 18, 2019
@karthiknadig
Copy link
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

@DonJayamanne
Copy link
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 @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?

@karthiknadig
Copy link
Member

@DonJayamanne @luabud How far back in terms of anaconda versions are we supporting?

@DonJayamanne
Copy link
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.

@karthiknadig
Copy link
Member

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

@brettcannon
Copy link
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.

@karthiknadig
Copy link
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.

@karthiknadig
Copy link
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.

@ghost ghost removed the needs PR label Nov 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments debt Covers everything internal: CI, testing, refactoring of the codebase, etc.
Projects
None yet
Development

No branches or pull requests

5 participants