Overview of Preferences.jl
masterPreferences.jl allows Julia packages to store configuration settings in persistent TOML files. These settings can be used at both run time and compile time (in Julia v1.6+).
Storage Mechanisms
- Local Preferences (Default): Stored in a
(Julia)LocalPreferences.tomlfile next to the currently active project. This is ideal for user-specific overrides and should be added to.gitignore. - Exported Preferences: If you set
export_prefs=truewhen calling@set_preferences!(), the settings are stored in the[preferences]section of the(Julia)Project.tomlfile. This is intended for shared project settings that should be distributed with the package.
Inheritance and Overriding
Preferences follow the Julia environment stack. Preferences set in higher-level environments (like a global depot) act as defaults but can be overridden by more proximal entries in the LOAD_PATH, such as the currently active project.