Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the development tools ruff (from 0.8 to 0.15) and mypy (from 1.8.0 to 1.19.1) to align local and pre-commit execution results. The PR includes necessary code changes to satisfy the new linter and type checker requirements.
Changes:
- Updated ruff version constraint from >=0.8 to >=0.15 and mypy from >=1.8.0 to >=1.19.1
- Migrated from
Enumwith multiple inheritance toStrEnumthroughout the codebase - Replaced
Optional[T]type hints withT | Noneunion syntax - Updated
cast()calls to use quoted string types for forward references - Fixed type checking issues and improved type hints for better type safety
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated version constraints for ruff (>=0.15) and mypy (>=1.19.1) |
| poetry.lock | Updated locked versions for ruff (0.15.0) and mypy (1.19.1), added librt dependency for mypy |
| .pre-commit-config.yaml | Updated pre-commit hook versions to match pyproject.toml (ruff v0.15.0, mypy v1.19.1) |
| tests/providers/github/integration/helpers/http_mock.py | Updated comment to reflect current mypy behavior |
| tests/operations/test_operation.py | Moved fmt comment after decorator to properly format function definition |
| otterdog/webapp/webhook/github_models.py | Migrated from Enum to StrEnum for AuthorAssociation |
| otterdog/webapp/utils.py | Changed cast to use quoted string type |
| otterdog/webapp/tasks/blueprints/pin_workflow.py | Improved type hint from generic dict to specific WorkflowFile type |
| otterdog/webapp/policies/init.py | Migrated from Enum to StrEnum for PolicyType |
| otterdog/webapp/db/models.py | Migrated to StrEnum and replaced Optional[T] with T | None throughout |
| otterdog/webapp/blueprints/init.py | Migrated from Enum to StrEnum for BlueprintType |
| otterdog/utils.py | Added type check to prevent runtime error, prefixed unused variable with underscore |
| otterdog/providers/github/graphql.py | Added status code check before accessing JSON data |
| otterdog/models/*.py | Updated cast() calls to quoted strings, reorganized imports to TYPE_CHECKING block |
| otterdog/logging.py | Changed cast to use quoted string type |
| DEPENDENCIES | Updated werkzeug version and added duplicate aiohttp-client-cache entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
there is a comment in unless something has changed, we need to keep it like that. the version of ruff in pre-commit and the project diverged and I had not noticed. What I do in another project to prevent that is to use pre-commit hooks like that: that will use the version of ruff from your local venv. I was also thinking of using |
|
@netomi it seems those ignore-settings did not work for some reason. Anyway it was fixed in 1.1.0 just recently art049/odmantic#500 That's why I made this odmantic update commit. |
…ssions and environment variables and secrets (#1) * Feature development: team with team-sync, external groups, team-permissions and environment variables and secrets * chore: update ruff and mypy (eclipse-csi#582) * chore: update ruff * chore: ruff auto fix * chore: ruff manual fixes * chore: update mypy and fix code * chore: fix ruff autofixes by updating odmantic See art049/odmantic#501 * chore: ruff format * chore: fix non formatting block * chore: remove fixme * Merge remote-tracking branch 'upstream/main' into feature/teampermission * fix: status added in _run_page_query as it is now used * chore: fixed by ruff * feat: add team sync variables to team --------- Co-authored-by: Alexander Lanin <Alexander.Lanin@etas.com>
Up to now local execution of ruff/mypy via CLI or via VS Code extensions produces very different results than execution via pre-commit. This PR does not address the underlying drift. Simply updating the versions used by pre-commit, and fixing the code along the way.
Note that I made individual commits to facilitate review.
Note2: I don't have the slightest idea why
pypi/pypi/-/aiohttp-client-cache/0.14.2is automatically added toDEPENDENCIES. It happens automatically and always.