Skip to content

Commit a718ae2

Browse files
committed
refactor: reorder imports and re-export in qs_codec module for clarity
fix: add profile setting for isort in tox configuration
1 parent d5e0981 commit a718ae2

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/qs_codec/__init__.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@
1616
# Package version (PEP 440). Bump in lockstep with distribution metadata.
1717
__version__ = "1.3.3"
1818

19-
from .decode import decode, load, loads
20-
from .encode import dumps, encode
21-
from .enums.charset import Charset
22-
from .enums.decode_kind import DecodeKind
23-
from .enums.duplicates import Duplicates
24-
from .enums.format import Format
25-
from .enums.list_format import ListFormat
26-
from .enums.sentinel import Sentinel
27-
from .models.decode_options import DecodeOptions
28-
from .models.encode_options import EncodeOptions
29-
from .models.undefined import Undefined
30-
31-
3219
# Public API surface re-exported at the package root.
3320
__all__ = [
3421
"decode",
@@ -46,3 +33,15 @@
4633
"EncodeOptions",
4734
"Undefined",
4835
]
36+
37+
from .decode import decode, load, loads
38+
from .encode import dumps, encode
39+
from .enums.charset import Charset
40+
from .enums.decode_kind import DecodeKind
41+
from .enums.duplicates import Duplicates
42+
from .enums.format import Format
43+
from .enums.list_format import ListFormat
44+
from .enums.sentinel import Sentinel
45+
from .models.decode_options import DecodeOptions
46+
from .models.encode_options import EncodeOptions
47+
from .models.undefined import Undefined

src/qs_codec/models/weak_wrapper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
from weakref import ReferenceType, WeakValueDictionary, ref
99

1010

11-
__all__ = ["WeakWrapper", "_proxy_cache"]
12-
13-
14-
# Exported for tests
15-
_proxy_cache: "WeakValueDictionary[int, _Proxy]" = WeakValueDictionary()
16-
_proxy_cache_lock = RLock()
17-
18-
1911
class _Proxy:
2012
"""Container for the original object.
2113
@@ -29,6 +21,14 @@ def __init__(self, value: t.Any) -> None:
2921
self.value = value
3022

3123

24+
__all__ = ["WeakWrapper", "_proxy_cache"]
25+
26+
27+
# Exported for tests
28+
_proxy_cache: "WeakValueDictionary[int, _Proxy]" = WeakValueDictionary()
29+
_proxy_cache_lock = RLock()
30+
31+
3232
def _get_proxy(value: t.Any) -> "_Proxy":
3333
"""Return a per-object proxy, cached by id(value)."""
3434
key = id(value)

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ commands =
4848
[testenv:isort]
4949
basepython = python3
5050
skip_install = true
51+
profile = black
5152
deps =
5253
isort
5354
commands =

0 commit comments

Comments
 (0)