Skip to content

Commit 60d719f

Browse files
committed
Minor changes ahead of 3.15
1 parent 93fe4b5 commit 60d719f

22 files changed

+131
-37
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ indent_size = 4
99

1010
[*.py]
1111
indent_style = space
12-
max_line_length = 90
12+
max_line_length = 80
1313

1414
[*.pyi]
1515
indent_style = space
16-
max_line_length = 90
16+
max_line_length = 80
1717

1818
[*.md]
1919
indent_style = space

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: [ '3.12', '3.13', '3.14-dev' ]
21+
python-version: [ '3.12', '3.13', '3.14' ]
2222

2323
name: "Type Coverage and Linting @ ${{ matrix.python-version }}"
2424
steps:
@@ -37,10 +37,10 @@ jobs:
3737
python -m pip install .
3838
3939
- name: "Run Pyright @ ${{ matrix.python-version }}"
40-
if: ${{ matrix.python-version != '3.14-dev' }}
4140
uses: jakebailey/pyright-action@v2
4241
with:
4342
warnings: false
43+
verify-types: "async_utils"
4444

4545
- name: Lint check
4646
uses: astral-sh/ruff-action@v3

_misc/_ensure_annotations.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
_cycle_blocked = False
2626

27-
rec = partial(compile, filename="<string>", mode="exec", flags=0, dont_inherit=True)
27+
rec = partial(
28+
compile, filename="<string>", mode="exec", flags=0, dont_inherit=True
29+
)
2830

2931

3032
def ensure_annotations[T: type | FunctionType](f: T) -> T:
@@ -55,7 +57,7 @@ def ensure_annotations[T: type | FunctionType](f: T) -> T:
5557

5658
def version_specific_annotation_interactions(obj: Any) -> None:
5759
if sys.version_info[:2] >= (3, 14):
58-
import annotationlib # pyright: ignore[reportMissingImports]
60+
import annotationlib # pyright: ignore[reportMissingTypeStubs]
5961

6062
if isinstance(obj, type):
6163
for t in inspect.getmro(obj):

_misc/_l.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ async def amain():
4242
for x in (True, False)
4343
]
4444
start = time.monotonic_ns()
45-
tsks = {loop.run(check(lock, start)) for loop in loops for _ in range(10)}
45+
tsks = {
46+
loop.run(check(lock, start)) for loop in loops for _ in range(10)
47+
}
4648
results = await asyncio.gather(*tsks)
4749
results.sort()
4850
print(*(f"{s} {e}" for s, e in results), sep="\n", flush=True) # noqa: T201

_misc/_queue_testing.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
log = logging.getLogger()
3333

3434
dt_fmt = "%Y-%m-%d %H:%M:%S"
35-
FMT = logging.Formatter("[%(asctime)s] [%(levelname)-8s}] %(name)s: %(message)s", dt_fmt)
35+
FMT = logging.Formatter(
36+
"[%(asctime)s] [%(levelname)-8s}] %(name)s: %(message)s", dt_fmt
37+
)
3638

3739

3840
_MSG_PREFIX = "\x1b[30;1m%(asctime)s\x1b[0m "
@@ -48,7 +50,9 @@
4850
)
4951

5052
FORMATS = {
51-
level: logging.Formatter(_MSG_PREFIX + color + _MSG_POSTFIX, "%Y-%m-%d %H:%M:%S")
53+
level: logging.Formatter(
54+
_MSG_PREFIX + color + _MSG_POSTFIX, "%Y-%m-%d %H:%M:%S"
55+
)
5256
for level, color in LC
5357
}
5458

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ reportDuplicateImport = "none" # handled by ruff
137137

138138
[tool.ruff]
139139

140-
line-length = 90
140+
line-length = 80
141141
target-version = "py312"
142142
preview = true
143143

@@ -189,7 +189,6 @@ ignore = [
189189
"TC003", # I prefer to avoid if TYPE_CHECKING
190190
"UP007", # "Use | For Union" doesn't account for typevar tuple unpacking.
191191
"UP031", # No, I like % formatting more for some things...
192-
"UP038", # isinstance on union types... perf + type construct symmetry issues.
193192
# As PYI058 modifies return values to be more narrow than they actually are
194193
"PYI058", # This opinionated "fix" causes incompatabilties with things expecting a generator.
195194
]

src/async_utils/_paramkey.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def __eq__(self, other: object, /) -> bool:
4040
_marker: tuple[object] = (object(),)
4141

4242

43-
def make_key(args: tuple[t.Any, ...], kwds: Mapping[t.Any, object], /) -> Hashable:
43+
def make_key(
44+
args: tuple[t.Any, ...], kwds: Mapping[t.Any, object], /
45+
) -> Hashable:
4446
key: tuple[t.Any, ...] = args
4547
if kwds:
4648
key += _marker

src/async_utils/_qs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from __future__ import annotations
1616

17+
__lazy_modules__ = ["asyncio"]
18+
1719
import asyncio
1820
import sys
1921
import threading
@@ -467,7 +469,9 @@ async def async_get(self, /) -> T:
467469

468470
return item
469471

470-
def sync_get(self, /, *, blocking: bool = True, timeout: float | None = None) -> T:
472+
def sync_get(
473+
self, /, *, blocking: bool = True, timeout: float | None = None
474+
) -> T:
471475
"""Get an item from the queue.
472476
473477
Parameters

src/async_utils/_simple_lock.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
__lazy_modules__ = ["asyncio"]
16+
1517
import asyncio
1618
import concurrent.futures as cf
1719
import threading

src/async_utils/bg_loop.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
from __future__ import annotations
1818

19+
__lazy_modules__ = ["asyncio"]
20+
1921
import asyncio
2022
import concurrent.futures as cf
2123
import threading

0 commit comments

Comments
 (0)