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

Support custom channel settings #33

Open
analog-cbarber opened this issue Jun 24, 2021 · 4 comments
Open

Support custom channel settings #33

analog-cbarber opened this issue Jun 24, 2021 · 4 comments

Comments

@analog-cbarber
Copy link

Any custom channel aliases configured in the user's .condarc file should be recognized so that users can write the alias instead of having to write out the full URL.

E.g. If you have:

custom_channels:
   my-channel: https://my-custom-server.com/

you should be able to specify my-channel as the channel rather than https://my-custom-server.com/my-channel

@analog-cbarber
Copy link
Author

To support this we would either need to run conda config --show custom_channels --json and parse the output or find the appropriate .condarc file (see https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#searching-for-condarc). I believe that conda reads all of the config files it can find in the search path in order and applies the keys, so the last file that specifies custom_channels is the correct one.

Probably easier to just call conda config.

@analog-cbarber
Copy link
Author

Note that if you run conda config without --json then the auth and token portions of the
original URL will be omitted, which is probably not what you want, so you will need to reconstruct
the URL from the fields reported in the json records.

@FaustinCarter
Copy link

Note that if you run conda config without --json then the auth and token portions of the
original URL will be omitted, which is probably not what you want, so you will need to reconstruct
the URL from the fields reported in the json records.

Worth pointing out that folks should really be using .netrc files for auth as conda will automatically insert the authentication into the URL as appropriate.

@analog-cbarber
Copy link
Author

Worth pointing out that folks should really be using .netrc files for auth as conda will automatically insert the authentication into the URL as appropriate.

Good to know. There is no mention of that in the conda docs.

I think support for that should be in a separate ticket since it applies to all HTTP urls, not just those in custom channels.

FYI, here is the conda code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants