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

PDM plugin configuration support #4176

Open
rakuzen25 opened this issue Oct 28, 2024 · 4 comments
Open

PDM plugin configuration support #4176

rakuzen25 opened this issue Oct 28, 2024 · 4 comments

Comments

@rakuzen25
Copy link

Area with issue?

JSON Schema

✔️ Expected Behavior

https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/partial-pdm.json currently does not support plugin-defined configuration (e.g. pdm.autoexport for https://github.com/pdm-project/pdm-autoexport).

❌ Actual Behavior

image

Additional properties are not allowed ('autoexport' was unexpected) is shown on validation.

YAML or JSON file that does not work.

# pyproject.toml

# This would work
[tool.pdm.dev-dependencies]
dev = ["black>=24.10.0"]

# But this won't
[[tool.pdm.autoexport]]
filename = "requirements.txt"
without-hashes = true

IDE or code editor.

Visual Studio Code

Are you making a PR for this?

No, someone else must create the PR.

@hyperupcall
Copy link
Member

Somewhat related to #3564

@abelcheung
Copy link
Contributor

abelcheung commented Dec 11, 2024

Currently the awesome PDM list has enlisted 20 PDM plugins, many of which are not under pdm-project umbrella. Probably another case that additionalProperties = true is applicable, as getting all plugin schemas implemented won't be happening in short future. Setting to true seems the fastest way to get things going, until somebody submits new schema required for validating config of each plugin.

@rakuzen25
Copy link
Author

Right. I don't know how the current system works for extensions of an existing tool, but I see that some PDM extensions are already being submitted, like #4231. Since I assume people may build private plugins or make changes to existing plugin configurations before publishing, I think it won't hurt to both allow additional properties and figure out how to add existing plugin schemas (at least the ones on the awesome PDM list) to the repo, if that's desired?

@abelcheung
Copy link
Contributor

abelcheung commented Dec 11, 2024

To present viewpoints in a balanced way, allowing additionalProperties also opens the pandora box of typos. So users can be scratching their head why their [[tool.pdm.autoexports]] fails to work, as hypothetical example. tox-dev/tox#1388 shows a real example, though for ini config format which can't be validated. It could mean trouble for applications which silently discard invalid config instead of making big fat warnings. So maybe need some input from somebody authorative too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants