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

ci: validate import statements in modules #204

Merged
merged 31 commits into from
Jan 10, 2025

Conversation

R1kaB3rN
Copy link
Member

@R1kaB3rN R1kaB3rN commented Jan 9, 2025

No description provided.

@Root-Core
Copy link
Contributor

Pyright already validates imports. What exactly are you trying to achieve?

@R1kaB3rN
Copy link
Member Author

R1kaB3rN commented Jan 9, 2025

Pyright already validates imports. What exactly are you trying to achieve?

I'm looking to validate imports but merging the import changes. Yeah, pyright would be better. Would you just rename the project directory then run it? I get reportMissingImports errors doing it that way?

@Root-Core
Copy link
Contributor

Root-Core commented Jan 9, 2025

#152 implements pyright in the workflow and it's working without any problem.. as long, as my changes are applied.

Most "import"antly #200, as this fixes the issues that pyright has with the imports.

@R1kaB3rN
Copy link
Member Author

R1kaB3rN commented Jan 9, 2025

Yeah, I want to merge 200 after having this check is in the CI. Because in 200, pyright isn't in yet.

@Root-Core
Copy link
Contributor

Root-Core commented Jan 9, 2025

We could merge pyright and limit it's scope / files to something that works for us. If it's only about the imports, we could just use the rules for the imports I guess.

Meanwhile #152 is the prove, that #200 is fine in regards of it's imports. The CI already verified them, as Pyright is active there and #200 is just a cherry-picked subset.

EDIT:
I just tested it and can confirm, that setting typeCheckingMode = "off" in the pyproject.toml checks the imports and works with the current code base. ijson and steam need to be installed though.

@R1kaB3rN
Copy link
Member Author

R1kaB3rN commented Jan 9, 2025

Meanwhile #152 is the prove, that #200 is fine in regards of it's imports. The CI already verified them, as Pyright is active there and #200 is just a cherry-picked subset.

Yeah, that logic makes sense...

@R1kaB3rN
Copy link
Member Author

R1kaB3rN commented Jan 9, 2025

EDIT: I just tested it and can confirm, that setting typeCheckingMode = "off" in the pyproject.toml checks the imports and works with the current code base. ijson and steam need to be installed though.

Mind referencing the docs for that? I can't find info about that value.

@R1kaB3rN
Copy link
Member Author

R1kaB3rN commented Jan 9, 2025

Well, in any case, I want to get this in for now. We can remove it later for pyright, which is faster.

@Root-Core
Copy link
Contributor

Root-Core commented Jan 9, 2025

Sure. I created PR #205, just have a look. It currently annotates the imports and flags it as a warning, but we could let the CI fail.

About the documentation:
https://github.com/microsoft/pyright/blob/main/docs/configuration.md#type-check-diagnostics-settings

@R1kaB3rN R1kaB3rN merged commit 1d2ebf2 into Open-Wine-Components:master Jan 10, 2025
2 checks passed
@R1kaB3rN R1kaB3rN deleted the test-imports branch January 10, 2025 00:01
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

Successfully merging this pull request may close these issues.

2 participants