taplo
taplo copied to clipboard
Bug in "Even Better Toml" v0.21.2. False negative. "Additional properties are not allowed ('ext-modules' was unexpected)"
# pyproject.toml
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "spammodule" # as it would appear on PyPI
version = "0.42"
[tool.setuptools]
ext-modules = [
{name = "spam", sources = ["spammodule.c"]}
]
[{
"..../pyproject.toml",
"owner": "_generated_diagnostic_collection_name_#4",
"severity": 8,
"message": "Additional properties are not allowed ('ext-modules' was unexpected)",
"source": "Even Better TOML",
"startLineNumber": 10,
"startColumn": 7,
"endLineNumber": 10,
"endColumn": 17
}]
This error is pretty annoying. Technically this field is of course optional, but when you need it to build extension modules you need it. It cannot be removed without breaking the build.
Is there a way to disable this specific error in the project?
Also, adding source attribute to dependencies causes a false positive:
[tool.poetry.dependencies]
requests = { source = "private-source" }
{"source":"private-source"} is not valid under any of the schemas listed in the 'anyOf' keyword
See poetry documentation: https://python-poetry.org/docs/dependency-specification/#projectdependencies-and-toolpoetrydependencies