Config information in Project.toml

Is it reasonable / possible to put config information in Project.toml? For instance, my_app_port = 8889. Are there facilities for parsing them? Or am I simply better off using environment variables somehow?

Sure, but why not have a Config.toml file instead?

Are there facilities for parsing them?

In Julia 1.6 you can use the TOML stdlib and in Julia < 1.6 Pkg.TOML.

3 Likes

I was hoping for a Pkg.current_environment_parsed_project_toml(). Then I would be sure that the config variables are those associated with the active Project.toml.

Ref:

https://github.com/JuliaLang/Pkg.jl/pull/1835

3 Likes