Allowable fields for Project.toml

I’d just like to know what fields are allowed in the Project.toml file of a package. I’ve conducted DuckDuckGo searches for documentation regarding the Project.toml of Julia packages and so far I have not found anything. By looking at the tomls of other packages I can see some commonalities, but it would be handy to have some documentation on this to look through. Does anyone know where I might find it?

Someone with more knowledge can chime in on anything that is not allowed, but my first guess would be that nothing is explicitly prohibited, but that Julia only reads certain fields. Here is where you can read more https://julialang.github.io/Pkg.jl/v1/toml-files/

4 Likes

I think that at the moment Pkg will ignore/preserve fields it does not use, but I am not sure one can keep relying on this. Eg

shell> cat Project.toml
name = "Foo"
uuid = "a6a9c512-8b32-4d2a-a66e-7c0225116af3"
authors = ["Tamas K. Papp <tkpapp@gmail.com>"]
version = "0.1.0"

bogus = "field"

(Foo) pkg> add UnPack
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
Updating `/tmp/Foo/Project.toml`
  [3a884ed6] + UnPack v1.0.1
Updating `/tmp/Foo/Manifest.toml`
  [3a884ed6] + UnPack v1.0.1

shell> cat Project.toml
name = "Foo"
uuid = "a6a9c512-8b32-4d2a-a66e-7c0225116af3"
authors = ["Tamas K. Papp <tkpapp@gmail.com>"]
bogus = "field"
version = "0.1.0"

[deps]
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
1 Like