Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry as as subschema #3286

Closed
henryiii opened this issue Oct 6, 2023 · 0 comments · Fixed by #3315
Closed

Poetry as as subschema #3286

henryiii opened this issue Oct 6, 2023 · 0 comments · Fixed by #3315
Labels
new-schema-request Request to add a new JSON schema. (auto-generated by issue forms)

Comments

@henryiii
Copy link
Contributor

henryiii commented Oct 6, 2023

Description of the JSON schema.

Currently, the pyproject.toml file has the standards tables defined in PEP 517 (build-system) and PEP 621 (project). And it has support for a couple of tools: Ruff (tool.ruff) and Poetry (tool.poetry). There's proposed support for Hatch (tool.hatch) as well. I'd like to add several more; I've created tool.cibuildwheel, tool.scikit-build, and tool.repo-review, all in their respective repos1. I also know where the schema for tool.setuptools is, and I know the author, so we could probably get that added. I'd also love to see common tools like pytest and mypy get subschemas.

This brings me to the request: Ruff and the proposed Hatch are subschemas, but for some reason (probably age) Poetry is built into the pyproject.toml file schema, even though it is just a tool section and not standards-based. I thin it seems much cleaner for all tools to have their own subschema, and Poetry plans (very eventually) to adopt PEP 621 and migrate away from putting everything in tool.poetry, so keeping it separate as a subschema and avoiding complicating main schema seems like a reasonable idea. Would that be acceptable? I could work on splitting it out if it's a good idea.

(This also has the benefit that it would be then reusable for validate-pyproject, which requires all tool sections to be subschemas).

Supporting information.

This one's already present, the request is just to split it out, so assuming you don't need extra info?

EDIT: I think this might be a feature request, because unlike Ruff, Poetry (along with setuptools, pytest, scikit-build, mypy, etc) don't support a secondary TOML-based config file format; the only TOML-based config is via pyproject.toml. When I tried this, I get Schema file name must be present in the catalog URL.. But adding all of them to a single file would be terrifying. EDIT-EDIT: Ahh, you can leave the file names empty.

Are you making a PR for this?

Yes, I will create a PR.

Footnotes

  1. Unrelated question: is it better to host these directly from the project repos's main branch, or should I make a copy when I contribute them? Both seem to be possible, not sure what's preferred here. EDIT: Ahh, I think Referencing an external schema by its URL within a local schema #2731 answers my question. :)

@henryiii henryiii added the new-schema-request Request to add a new JSON schema. (auto-generated by issue forms) label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-schema-request Request to add a new JSON schema. (auto-generated by issue forms)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant