Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
python-version: ["3.12", "3.13", "3.14"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
[project]
name = "itrx"
version = "0.1.5"
version = "0.1.6"
description = "A chainable iterator adapter"
readme = "README.md"
authors = [
{ name = "virgesmith", email = "andrew@friarswood.net" }
]
license-files = ["LICENCE.md"]
requires-python = ">=3.12"
classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = []

[project.urls]
Expand Down Expand Up @@ -39,7 +46,7 @@ addopts = "--cov=src/itrx --cov-report html --cov-fail-under=100 --doctest-modul
line-length = 120

[tool.ruff.lint]
select = ["B", "C", "D103", "E", "F", "I", "SIM"]
select = ["ARG", "B", "C", "D103", "E", "F", "I", "N", "PERF", "PTH", "RET", "RUF", "SIM", "UP", "W"]
ignore = ["E501"]

[tool.ruff.lint.per-file-ignores]
Expand Down
6 changes: 3 additions & 3 deletions src/itrx/itr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import itertools
from collections.abc import Generator, Iterable
from typing import Callable, Iterator, TypeVar, overload
from collections.abc import Callable, Generator, Iterable, Iterator
from typing import TypeVar, overload

T = TypeVar("T")
_CollectT = TypeVar("_CollectT") # General item type for collected containers
Expand Down Expand Up @@ -629,7 +629,7 @@ def unzip[U, V](self) -> tuple["Itr[U]", "Itr[V]"]:
"""
# TODO express that T is tuple[U, V]
it1, it2 = itertools.tee(self._it, 2)
return Itr((x[0] for x in it1)), Itr((x[1] for x in it2)) # type: ignore[index]
return Itr(x[0] for x in it1), Itr(x[1] for x in it2) # type: ignore[index]

def value_counts(self) -> "Itr[tuple[T, int]]":
"""
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/introspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def generate_apidoc(cls: type, file: Path) -> None:
.map(lambda m: (m, getattr(Itr, m).__doc__))
)

with open(file, "w") as fd:
with file.open("w") as fd:
fd.write(f"# `Itr` v{itrx_version} class documentation\n")
fd.write(Itr.__doc__ or "")
fd.write("## Public methods\n")
Expand Down
2 changes: 1 addition & 1 deletion src/test/test_combine_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_partition_all_false() -> None:

def test_partition_empty() -> None:
it: Itr[int] = Itr([])
a, b = it.partition(lambda x: True)
a, b = it.partition(lambda _: True)
assert a.collect() == ()
assert b.collect() == ()

Expand Down
4 changes: 2 additions & 2 deletions src/test/test_transform_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_skip_while_all_skipped() -> None:


def test_skip_while_empty_iterable() -> None:
it = Itr[str]([]).skip_while(lambda x: True)
it = Itr[str]([]).skip_while(lambda _: True)
assert it.collect() == ()


Expand Down Expand Up @@ -106,7 +106,7 @@ def test_take_while_none_true() -> None:

def test_take_while_empty_iterable() -> None:
it = Itr[float]([])
taken = it.take_while(lambda x: True)
taken = it.take_while(lambda _: True)
assert taken.collect() == ()


Expand Down
Loading