taplo
taplo copied to clipboard
Poetry schema changes for upcomming v1.2
Poetry v1.2 will introduce dependency groups which have there own entries in the pyproject.toml file.
I currently use the v1.2 alpha version and Even Better Toml throws me the "unknown property" error for those new keys or rather the first occurrence.
To declare a new dependency group, use a tool.poetry.group.
<group>
section where<group>
is the name of your dependency group (for instance, test):[tool.poetry.group.test] # This part can be left out [tool.poetry.group.test.dependencies] pytest = "^6.0.0" pytest-mock = "*"
Source: https://python-poetry.org/docs/master/managing-dependencies/
Further, all development dependencies are moving to a group called dev
. For instance:
[tool.poetry.group.dev.dependencies]
mypy = "^0.950"
pytest = "^6.0"
pytest-isort = "^3.0.0"
pytest-flake8 = "^1.0"
pytest-black = "^0.3.12"
pytest-datadir = "^1.3.1"
Any update on this issue?
I haven't worked on this, PRs are welcome.
Is it just a matter of updating pyproject.toml.json? If so, I can give a try, I suppose.
Yes, mostly, much appreciated!
It also has to be submitted to the schema store, as I've deprecated taplo's own hosted catalog, but it's a tiny task, you can submit the PR here and I'll do it or you can submit it directly to the schema store as well.
Hai! :wave:
I'm working on this exact PR for SchemaStore on my add-schemas-taplo, copying everything over went pretty smoothly - just had to make several modifications since the schemas were being parsed in Strict Mode and add some other schemastore-specific metadata files. (Schemastore also has a similar issue for adding pyproject.toml)
I did have a question though, what is the uniqueness
keyword in the JSON schema? It seems it's a part of some future JSON Schema standard, but I couldn't find any info about it when quickly perusing the reference. In my wip branch, I had to do a dirty hack so things would validate under strict mode, but i don't think I would want to keep that in my final PR
I did have a question though, what is the uniqueness keyword in the JSON schema?
I have absolutely no idea, as far as I see it is in the dein
schema, it was contributed by someone else. Taplo itself doesn't use it, nor is it used for validation if it's not part of any schema drafts.
Poetry v.1.2.0rc1 was released a few days ago and it looks like poetry-core has an update-to-date JSON schema here.
Maybe this helps? 😄
It also looks poetry has an additional JSON schema
that includes, at least, the schema for tool.poetry.source
.
Cool - any updates now would go through schemastore repository, since the taplo schemas were moved over there. I think I forgot to mention in this thread, but it was merged there on July 23
There have been a few updates to the pyproject.json
in particular, but I don't think any of them cover the v1.2.0 updates
@hyperupcall @tamasfe @Cielquan I have backported all the recent changes from the Poetry schema (and then some).
See https://github.com/SchemaStore/schemastore/pull/2443.
Update: the changes have been merged into schemastore.
@tamasfe What would be the next step to have taplo (and the VS Code extension) pick up the updated schema?
Thank you! There should be no further action needed, the schema should be fetched as the cache expires.