diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22e40d1..1d42ac5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: language: python files: \.py$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.2.2" + rev: "v0.3.2" hooks: - id: ruff-format - repo: https://github.com/pre-commit/mirrors-prettier @@ -25,7 +25,7 @@ repos: language: python additional_dependencies: [pygments, restructuredtext_lint] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy files: ^(src/|tests/) diff --git a/examples/drag_and_drop/main.py b/examples/drag_and_drop/main.py index f85f0b4..cf1c3cb 100644 --- a/examples/drag_and_drop/main.py +++ b/examples/drag_and_drop/main.py @@ -2,6 +2,7 @@ Display drag from the app into the graph widget and the event bridge. This is similar to the hello world sample. """ + import sys from PyQt5 import QtWidgets diff --git a/examples/hello_world/main.py b/examples/hello_world/main.py index e9806be..16194d7 100644 --- a/examples/hello_world/main.py +++ b/examples/hello_world/main.py @@ -1,6 +1,7 @@ """ We all love "hello world" examples =) """ + import sys from PyQt5 import QtWidgets diff --git a/examples/styles/main.py b/examples/styles/main.py index c7e7a6b..a39aa4b 100644 --- a/examples/styles/main.py +++ b/examples/styles/main.py @@ -1,6 +1,7 @@ """ Display the use of styles. This is similar to the hello world sample. """ + import sys from PyQt5 import QtWidgets diff --git a/scripts/svg_to_stencil.py b/scripts/svg_to_stencil.py index 226f66b..8ad623e 100644 --- a/scripts/svg_to_stencil.py +++ b/scripts/svg_to_stencil.py @@ -37,6 +37,7 @@ * it isn't feature complete, as it is evolving according new SVGs are created and converted to stencils. """ + import abc import itertools import os diff --git a/src/qmxgraph/cell_bounds.py b/src/qmxgraph/cell_bounds.py index 9f96878..1d65a0f 100644 --- a/src/qmxgraph/cell_bounds.py +++ b/src/qmxgraph/cell_bounds.py @@ -7,6 +7,7 @@ - :attr:`qmxgraph.widget.EventsBridge.on_cell_geometry_changed` """ + from typing import Any from typing import Optional diff --git a/src/qmxgraph/common_testing.py b/src/qmxgraph/common_testing.py index 85a5ecc..680343d 100644 --- a/src/qmxgraph/common_testing.py +++ b/src/qmxgraph/common_testing.py @@ -1,6 +1,7 @@ """ Those are helper tools that could help in applications' tests. """ + from typing import cast from typing import List diff --git a/src/qmxgraph/decoration_contents.py b/src/qmxgraph/decoration_contents.py index 71fde18..6d81c86 100644 --- a/src/qmxgraph/decoration_contents.py +++ b/src/qmxgraph/decoration_contents.py @@ -5,6 +5,7 @@ - :meth:`qmxgraph.api.QmxGraphApi.update_table` """ + from functools import lru_cache from typing import Dict from typing import List diff --git a/src/qmxgraph/mime.py b/src/qmxgraph/mime.py index 517a08c..68c18f2 100644 --- a/src/qmxgraph/mime.py +++ b/src/qmxgraph/mime.py @@ -41,6 +41,7 @@ } """ + import json import qmxgraph.constants diff --git a/src/qmxgraph/server.py b/src/qmxgraph/server.py index 2d97d6b..642cd04 100644 --- a/src/qmxgraph/server.py +++ b/src/qmxgraph/server.py @@ -3,6 +3,7 @@ used embedded with QGraphWidget. Helpful to test graph widget features using Selenium, for instance. """ + import os from contextlib import contextmanager