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

Fix mypy-ribasim-qgis and add to CI #1067

Closed
visr opened this issue Feb 2, 2024 · 2 comments · Fixed by #1078
Closed

Fix mypy-ribasim-qgis and add to CI #1067

visr opened this issue Feb 2, 2024 · 2 comments · Fixed by #1078
Labels
CI/CD Continuous Integration/Continuous deployment QGIS Ribasim QGIS plugin

Comments

@visr
Copy link
Member

visr commented Feb 2, 2024

This would need this commit:
Add mypy to python_lint github actions

And the fix to these issues that it finds:

✨ Pixi task (default): mypy ribasim_qgis
Warning: --strict-concatenate is deprecated; use --extra-checks instead
ribasim_qgis/tests/test_load_plugin.py:[5](https://github.com/Deltares/Ribasim/actions/runs/7757356113/job/21156633632#step:8:6): error: Class cannot subclass "TestCase" (has type "Any")  [misc]
ribasim_qgis/tests/test_load_plugin.py:12: error: Class cannot subclass "TestCase" (has type "Any")  [misc]
ribasim_qgis/ribasim_qgis.py:[10](https://github.com/Deltares/Ribasim/actions/runs/7757356113/job/21156633632#step:8:11): error: Class cannot subclass "QgsDockWidget" (has type "Any")  [misc]
ribasim_qgis/tests/core/test_model.py:11: error: Class cannot subclass "TestCase" (has type "Any")  [misc]
Found 4 errors in 3 files (checked 22 source files)
@visr visr added CI/CD Continuous Integration/Continuous deployment QGIS Ribasim QGIS plugin labels Feb 2, 2024
@deltamarnix
Copy link
Contributor

@Hofer-Julian We found out that github actions is using pixi 0.13.0, and that makes it fail. When we revert to 0.12.0 everything is fine and we have no mypy issues.

It seems like pixi 0.13.0 is breaking our environment for mypy.
We have tried installing 0.13.0 and threw away our lock file so 0.13.0 could make a new one. But that didn't seem to resolve the issue. How could we make a simple environment and report an issue to the pixi developers?

@Hofer-Julian
Copy link
Contributor

Yeah, sounds like something changed in pixi and because of that mypy can't find the type hints for TestCase.
I'm not 100% sure though if it really is a pixi bug.
Since it's just two lints, I suggest to just type ignore them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Continuous Integration/Continuous deployment QGIS Ribasim QGIS plugin
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants