Skip to content

Commit 95f10d5

Browse files
committed
test: remove unused base32 imports after dropping fallback logic
1 parent 6c4cd65 commit 95f10d5

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

tests/test_base32.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import builtins
2-
import importlib
3-
import sys
4-
5-
import pytest
61
from typeid.base32 import decode, encode
72

83

typeid/typeid.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
import uuid_utils
44
from typing import Generic, Optional, TypeVar
55

6-
import uuid as std_uuid
7-
86
from typeid import base32
97
from typeid.errors import InvalidTypeIDStringException
108
from typeid.validation import validate_prefix, validate_suffix_and_decode
119

1210
PrefixT = TypeVar("PrefixT", bound=str)
1311

1412

15-
def _uuid_from_bytes_v7(uuid_bytes: bytes) -> std_uuid.UUID:
13+
def _uuid_from_bytes_v7(uuid_bytes: bytes) -> uuid_utils.UUID:
1614
"""
1715
Construct a UUID object from bytes.
1816
"""
@@ -67,7 +65,7 @@ def __init__(self, prefix: Optional[PrefixT] = None, suffix: Optional[str] = Non
6765
self._prefix: Optional[PrefixT] = prefix
6866

6967
self._str: Optional[str] = None
70-
self._uuid: Optional[std_uuid.UUID] = None
68+
self._uuid: Optional[uuid_utils.UUID] = None
7169
self._uuid_bytes: Optional[bytes] = None
7270

7371
if not suffix:
@@ -109,7 +107,7 @@ def from_string(cls, string: str) -> "TypeID":
109107
return cls(suffix=suffix, prefix=prefix)
110108

111109
@classmethod
112-
def from_uuid(cls, suffix: std_uuid.UUID, prefix: Optional[PrefixT] = None) -> "TypeID":
110+
def from_uuid(cls, suffix: uuid_utils.UUID, prefix: Optional[PrefixT] = None) -> "TypeID":
113111
"""
114112
Construct a TypeID from an existing UUID.
115113
@@ -164,7 +162,7 @@ def prefix(self) -> str:
164162
return self._prefix or ""
165163

166164
@property
167-
def uuid(self) -> std_uuid.UUID:
165+
def uuid(self) -> uuid_utils.UUID:
168166
"""
169167
The UUID represented by this TypeID.
170168
@@ -296,7 +294,7 @@ def from_string(string: str) -> TypeID:
296294
return TypeID.from_string(string=string)
297295

298296

299-
def from_uuid(suffix: std_uuid.UUID, prefix: Optional[str] = None) -> TypeID:
297+
def from_uuid(suffix: uuid_utils.UUID, prefix: Optional[str] = None) -> TypeID:
300298
warnings.warn("Consider TypeID.from_uuid instead.", DeprecationWarning)
301299
return TypeID.from_uuid(suffix=suffix, prefix=prefix)
302300

0 commit comments

Comments
 (0)