Skip to content

Commit cfb03fa

Browse files
committed
test: enable ruff flake8-type-checking lints
1 parent 9aebd15 commit cfb03fa

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ select = [
9191
"SLOT", # flake8-slots
9292
"SIM", # flake8-simplify
9393
"TID", # flake8-tidy-imports
94+
"TCH", # flake8-type-checking
9495
]
9596
ignore = [
9697
"ISC001", # Implicitly concatenated string literals on one line

src/simpy/events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""
1616
from __future__ import annotations
1717

18-
from types import FrameType
1918
from typing import (
2019
TYPE_CHECKING,
2120
Any,
@@ -34,6 +33,8 @@
3433
from simpy.exceptions import Interrupt
3534

3635
if TYPE_CHECKING:
36+
from types import FrameType
37+
3738
from simpy.core import Environment, SimTime
3839

3940
PENDING: object = object()

src/simpy/resources/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"""
99
from __future__ import annotations
1010

11-
from types import TracebackType
1211
from typing import (
1312
TYPE_CHECKING,
1413
ClassVar,
@@ -24,6 +23,9 @@
2423
from simpy.core import BoundClass, Environment
2524
from simpy.events import Event, Process
2625

26+
if TYPE_CHECKING:
27+
from types import TracebackType
28+
2729
ResourceType = TypeVar('ResourceType', bound='BaseResource')
2830

2931

src/simpy/resources/resource.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@
3030
"""
3131
from __future__ import annotations
3232

33-
from types import TracebackType
3433
from typing import TYPE_CHECKING, Any, List, Optional, Type
3534

3635
from simpy.core import BoundClass, Environment, SimTime
37-
from simpy.events import Process
3836
from simpy.resources import base
3937

38+
if TYPE_CHECKING:
39+
from types import TracebackType
40+
41+
from simpy.events import Process
42+
4043

4144
class Preempted:
4245
"""Cause of a preemption :class:`~simpy.exceptions.Interrupt` containing

0 commit comments

Comments
 (0)