abravalheri / validate-pyproject

Validation library for simple check on `pyproject.toml`
https://validate-pyproject.readthedocs.io/
Mozilla Public License 2.0
130 stars 12 forks source link

Bug? `tool.poetry.packages[0]` must not contain {'to'} properties #177

Closed jamesbraza closed 5 months ago

jamesbraza commented 5 months ago

From https://python-poetry.org/docs/pyproject/#packages:

The to parameter is designed to specify the relative destination path where the package will be located upon installation. This allows for greater control over the organization of packages within your project’s structure.

However, when I have a to in my pyproject.toml's packages like this:

[tool.poetry]
packages = [
    {from = "app", include = "apples", to = "foo/app"},
    {include = "app/*.py", to = "foo"},
    {include = "app/py.typed", to = "foo"},
]

With validate-pyproject v0.18 I get:

Invalid file: pyproject.toml
[ERROR] `tool.poetry.packages[0]` must not contain {'to'} properties

Is this a bug in validate-pyproject? And if not, why is to disallowed?

abravalheri commented 5 months ago

I believe in this case, the definitions are coming from https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/partial-poetry.json .

It might be worth it to double-check if that spec makes sense (sorry, I have not used poetry many times).

henryiii commented 5 months ago

The is fairly new: https://python-poetry.org/history/#180---2024-02-25 and needs to be updated in SchemaStore. Contributions usually welcome (also can open an issue there).

jamesbraza commented 5 months ago

Made https://github.com/SchemaStore/schemastore/pull/3807 to match https://github.com/python-poetry/poetry-core/pull/672, closing this out

henryiii commented 5 months ago

Synced: https://github.com/henryiii/validate-pyproject-schema-store/releases/tag/2024.05.24