Skip to content

Commit 620091f

Browse files
Add LinodeClient type annotation in Group class (#314)
## 📝 Description Better dev experience with an IDE or text editor with this typing.
1 parent 680c5a2 commit 620091f

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

linode_api4/groups/group.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
from __future__ import annotations
2+
3+
from typing import TYPE_CHECKING
4+
5+
if TYPE_CHECKING:
6+
from linode_api4 import LinodeClient
7+
8+
19
class Group:
2-
def __init__(self, client: "LinodeClient"):
10+
def __init__(self, client: LinodeClient):
311
self.client = client

linode_api4/linode_client.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,25 @@
1010
from requests.adapters import HTTPAdapter, Retry
1111

1212
from linode_api4.errors import ApiError, UnexpectedResponseError
13-
from linode_api4.groups import *
14-
from linode_api4.objects import *
13+
from linode_api4.groups import (
14+
AccountGroup,
15+
DatabaseGroup,
16+
DomainGroup,
17+
ImageGroup,
18+
LinodeGroup,
19+
LKEGroup,
20+
LongviewGroup,
21+
NetworkingGroup,
22+
NodeBalancerGroup,
23+
ObjectStorageGroup,
24+
PollingGroup,
25+
ProfileGroup,
26+
RegionGroup,
27+
SupportGroup,
28+
TagGroup,
29+
VolumeGroup,
30+
)
31+
from linode_api4.objects import Image, and_
1532
from linode_api4.objects.filtering import Filter
1633

1734
from .common import SSH_KEY_TYPES, load_and_validate_keys

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ line-length = 80
1111
target-version = ["py37", "py38", "py39", "py310", "py311"]
1212

1313
[tool.autoflake]
14-
expand-star-imports = false
14+
expand-star-imports = true
1515
ignore-init-module-imports = true
1616
ignore-pass-after-docstring = true
1717
in-place = true

0 commit comments

Comments
 (0)