mariusvniekerk / condax

Install and run applications packaged with conda in isolated environments

Home Page:https://mariusvniekerk.github.io/condax/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scriptable (commandline) customization of CONDAX_LINK_DESTINATION (link_destination)

mforbes opened this issue · comments

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"]))

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/

@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.

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

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