-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
434: Static Type Checker Mypy added to CI & as a poe task in pyproject.toml #507
base: main
Are you sure you want to change the base?
Conversation
eea2e47
to
33568c5
Compare
This looks great, would you be willing to look into addressing the top level mypy failures while you're at it. We should be able to config mypy in pyproject.toml to allow duplicate module names in separate subdirectories. |
Signed-off-by: Aditya Gidh <aagidh@us.ibm.com>
Signed-off-by: Aditya Gidh <aagidh@us.ibm.com>
Signed-off-by: Aditya Gidh <aagidh@us.ibm.com>
Signed-off-by: Aditya Gidh <aagidh@us.ibm.com>
9fb92b8
to
e14069a
Compare
Signed-off-by: Aditya Gidh <aagidh@us.ibm.com>
e14069a
to
830ca5a
Compare
@ajbozarth : Initially I updated mypy’s configuration to allow for duplicate module names in separate subdirectories.
But it complained about other things with "Source file found twice under different module names". Therefore added empty |
Thanks, I checked it out and played with it a bit and I think you only need the init.py at the root of examples to fix it, so you can delete the others. Otherwise I think this is g2g |
@@ -245,6 +245,12 @@ help = "Extract Python files only" | |||
args = [{ name = "TARGET", positional = true, multiple = true }] | |||
shell = "printf '%s\\n' $TARGET | grep -E '\\.(py|ipynb)$' | tr '\\n' ' '" | |||
|
|||
[tool.poe.tasks] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work like poe lint and poe format, so this would be [tool.poe.tasks.type-check]
and reformat the following lines to work similar to the other poe.tasks section above
Which issue(s) does this pull-request address?
Closes: #434
Description
Added MyPy type checking as a poe task and as a CI workflow action. Added in tasks for different type checking scenarios.
type-check = "mypy ."
type-check-strict = "mypy --strict ."
type-check-verbose = "mypy --verbose --show-error-context --pretty ."
Captured examples of failures in the Git Actions: https://github.com/i-am-bee/beeai-framework/actions/runs/13707535290/job/38336396042?pr=507
Example failures while running these locally:

poetry run poe type-check-strict
Checklist
yarn lint
oryarn lint:fix
yarn format
oryarn format:fix
yarn test:unit
yarn test:e2e