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

tool.mypy validation false failure for strict_bytes #106

Closed
tsvikas opened this issue Feb 5, 2025 · 6 comments
Closed

tool.mypy validation false failure for strict_bytes #106

tsvikas opened this issue Feb 5, 2025 · 6 comments

Comments

@tsvikas
Copy link

tsvikas commented Feb 5, 2025

When using

[tool.mypy]
strict_bytes = true

the validator fails

This config is new in mypy 1.15 link

I'm not sure who updates the schema and how.

@henryiii
Copy link
Owner

henryiii commented Feb 5, 2025

It's from here: https://json.schemastore.org/partial-mypy.json

It's just updated by contributors occasionally: https://github.com/SchemaStore/schemastore/pulls?q=is%3Apr+mypy+is%3Aclosed

I wrote a PR to add generation to mypy, but it stalled. python/mypy#16601

@henryiii
Copy link
Owner

henryiii commented Feb 5, 2025

PR: SchemaStore/schemastore#4420

@tsvikas
Copy link
Author

tsvikas commented Feb 6, 2025

Thanks! 🤩

is there any way to tell validate-pyproject-scheme to ignore this line for now?

@tsvikas
Copy link
Author

tsvikas commented Feb 6, 2025

(like a #noqa: schema comment)

@henryiii
Copy link
Owner

henryiii commented Feb 6, 2025

I'm not aware of one, other than not validating for now. @abravalheri might have ideas? It's tricky, as you can't just ignore lines trivially. I wonder if we could do some pre-processing, though? I think you'd pretty much have to write a TOML parser to pre-process it correctly, though (some other TOML parsers can keep comments, like the Rust one, but we can't use that in validate-pyproject).

@abravalheri
Copy link

For now validate-pyproject API assumes that the input is a simple dict (and the CLI uses tomllib for the parsing), so annotations are not viable.

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