-
-
Notifications
You must be signed in to change notification settings - Fork 24
Description
It would be nice to have uniform way to specify package configuration options. Currently, I'm using environment variables for this (e.g. PYTHON in PyCall), but that is somewhat non-Julian. More importantly, it requires some manual effort for me to save the option in a file so that it is "remembered" when you do Pkg.update
etcetera even if the environment variable is no longer set. Many packages will get this wrong, and even if they get it right it is a lot of duplication of effort.
My suggestion would be that the package TOML file should have something like:
[option.python]
value = "python3" # default
The user interface would be something like:
Pkg.option("PyCall", :python)
— return the current choice (saved in a file somewhere)Pkg.option("PyCall", python="python2")
— change the option, maybe rebuilding automatically unless this is called by the package during the buildPkg.add
andPkg.build
will acceptpython="python2"
keyword arguments to set options when installing/building.
The value of all options would be saved in an options.toml
file somewhere.
A related mechanism would be used for package alternatives, see #37.