CLI config file and Default project config file names
Naming is hard but necessary!
We need a place to PyScript CLI global configurations (that I'm referring to as CLI config file) and PyScript apps now have a JSON/[TOML] format for Apps configuration. So we need to choose a default name for that file when the CLI creates a new project (referring to as project config).
My proposal here is that:
- we use TOML for the CLI config file format
- we name it
pyscript.config.tomlor.pyscriptconfig - we name the default project config file to
pyscript.json
/cc @ntoll @mattkram
My vote is to use TOML for local CLI config. Ideally, we would either use pyscript.toml, or define our own sections inside pyproject.toml. When a PyScript project is uploaded, or bundled/built via the CLI, we could do a json.dumps(toml.load(fp)) to convert to the JSON format required by PyScript itself.
To summarize, my preference would be to:
- Use TOML because it's easier for humans to edit and already becoming the new standard for tool config.
- If we can, use
pyproject.tomlto stick with the standard, and potentially open us up to being able to define a build backend via PEP 518 in the future. This is already common for tool config, e.g. forblack, even if you aren't defining a package. - Converting the config from TOML -> JSON should be pretty trivial for the CLI to do, whether in an Upload, or Bundle, or ...
- The detail of storing config in TOML and converting, or including a JSON file, could be configured inside the TOML file so the user can decide. This detail can be deferred.
Oh sorry., duh. Yeah... +1 from me as well on using TOML as well for the default project config.
I'm -1 on using pyproject.toml because they are VERY different and that, imho, would actually confusing.
Points 3 and 4 might not even be necessary.
Thoughts on my point 2?
Assuming you mean the naming, I'd vote to have a section [config] or [pyscript.config] inside pyscript.toml.
Having at least one level of nesting opens the structure of the file up for later expansion if needed.