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

Scriptable (commandline) customization of CONDAX_LINK_DESTINATION (link_destination) #16

Open
mforbes opened this issue Jul 11, 2022 · 4 comments

Comments

@mforbes
Copy link

mforbes commented Jul 11, 2022

The link_destination can be customized in the .condarc, but this is inconvenient for scripts.

It would be helpful if this could be set on the command line, either with a specific flag, or through an environmental variable.

For reference, pipx uses PIPX_BIN_DIR.

My use-case is to use condax to provision my system, so need to link the executables to /usr/local/bin/ rather than a home directory.

A quick hack would be something like this in config.py:

CONDAX_LINK_DESTINATION = path.expanduser(
    os.environ.get(
        'CONDAX_LINK_DESTINATION',
        _config["link_destination"]))
@yamaton
Copy link
Contributor

yamaton commented Jul 12, 2022

Typically, link_destination entry in ~/.condaxrc sets the link destination.
https://mariusvniekerk.github.io/condax/config/

But in your case, you need to run with sudo hence /root/.condaxrc is the location.

link_destination: /usr/local/bin/

@mforbes
Copy link
Author

mforbes commented Jul 12, 2022

@yamaton Thanks. That works, but it is not very convenient for scripts. I have changed this to a feature request for a command-line option (or environmental variable) way of modifying this for install scripts.

@mforbes mforbes changed the title Customize CONDAX_LINK_DESTINATION Scriptable customization of CONDAX_LINK_DESTINATION (link_destination) Jul 12, 2022
@mforbes mforbes changed the title Scriptable customization of CONDAX_LINK_DESTINATION (link_destination) Scriptable (commandline) customization of CONDAX_LINK_DESTINATION (link_destination) Jul 12, 2022
@mariusvniekerk
Copy link
Owner

Moving the configuration system to allow it to make use of something like pydantic's BaseSettings will probably help a bunch

@mforbes
Copy link
Author

mforbes commented Jul 13, 2023

Is there a plan to do this? It would really help to have this customizability.

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

3 participants