Skip to content

Commit

Permalink
Migrate to the latest version of the wraps library.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekitdev committed Apr 23, 2024
1 parent db9cba8 commit 07cee61
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<!-- changelogging: start -->

## 0.18.0 (2024-04-23)

### Changes

- Migrated to the latest version of the `wraps` library.

## 0.17.0 (2024-03-23)

### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Or by directly specifying it in the configuration like so:

```toml
[tool.poetry.dependencies]
iters = "^0.17.0"
iters = "^0.18.0"
```

Alternatively, you can add it directly from the source:
Expand Down
2 changes: 1 addition & 1 deletion iters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__title__ = "iters"
__author__ = "nekitdev"
__license__ = "MIT"
__version__ = "0.17.0"
__version__ = "0.18.0"

from iters.async_iters import (
AsyncIter,
Expand Down
8 changes: 4 additions & 4 deletions iters/async_iters.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
Validate,
)
from typing_extensions import Never, ParamSpec
from wraps.early import early_option_await
from wraps.option import Option, Some
from wraps.result import Result
from wraps.wraps import wrap_future, wrap_future_option, wrap_future_result
from wraps.early.decorators import early_option_await
from wraps.primitives.option import Option, Some
from wraps.primitives.result import Result
from wraps.wraps.futures import wrap_future, wrap_future_option, wrap_future_result

from iters.async_utils import (
async_accumulate_fold,
Expand Down
4 changes: 2 additions & 2 deletions iters/async_wraps.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import AsyncIterator, TypeVar

from typing_aliases import AnyIterable, AsyncBinary, AsyncUnary, Binary, Unary
from wraps.option import NULL, Option, Some
from wraps.result import Error, Ok, Result
from wraps.primitives.option import NULL, Option, Some
from wraps.primitives.result import Error, Ok, Result

from iters.async_utils import async_chain, async_iter, async_next_unchecked
from iters.types import is_marker, marker
Expand Down
6 changes: 3 additions & 3 deletions iters/iters.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
Unary,
)
from typing_extensions import Never, ParamSpec
from wraps.early import early_option
from wraps.option import Option, Some
from wraps.result import Result
from wraps.early.decorators import early_option
from wraps.primitives.option import Option, Some
from wraps.primitives.result import Result

from iters.constants import DEFAULT_START, DEFAULT_STEP, EMPTY_BYTES, EMPTY_STRING
from iters.ordered_set import OrderedSet, ordered_set
Expand Down
4 changes: 2 additions & 2 deletions iters/mapping_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from attrs import frozen
from typing_extensions import Self
from wraps.wraps import WrapOption
from wraps.wraps.option import wrap_option_on

__all__ = ("MappingView", "mapping_view")

K = TypeVar("K")
V = TypeVar("V")

wrap_key_error = WrapOption(KeyError)
wrap_key_error = wrap_option_on(KeyError)


@final
Expand Down
9 changes: 6 additions & 3 deletions iters/ordered_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from named import get_type_name
from typing_aliases import AnySet, is_instance, is_sized, is_slice
from typing_extensions import TypeIs
from wraps.wraps import wrap_option
from wraps.wraps.option import wrap_option_on

__all__ = ("OrderedSet", "ordered_set", "ordered_set_unchecked")

Expand Down Expand Up @@ -49,6 +49,9 @@ def is_any_set(iterable: Iterable[T]) -> TypeIs[AnySet[T]]:
return is_instance(iterable, AnySet)


wrap_index_error = wrap_option_on(IndexError)


class OrderedSet(MutableSet[Q], Sequence[Q]):
"""Represents ordered sets, i.e. mutable hash sets that preserve insertion order.
Expand Down Expand Up @@ -350,7 +353,7 @@ def index(self, item: Q, start: Optional[int] = None, stop: Optional[int] = None

return index

get_index = wrap_option(index)
get_index = wrap_index_error(index)
"""An alias of [`index`][iters.ordered_set.OrderedSet.index] wrapped to return
[`Option[int]`][wraps.option.Option] instead of erroring.
"""
Expand Down Expand Up @@ -405,7 +408,7 @@ def pop(self, index: int = LAST) -> Q:

return item

get_pop = wrap_option(pop)
get_pop = wrap_index_error(pop)
"""An alias of [`pop`][iters.ordered_set.OrderedSet.pop] wrapped to return
[`Option[Q]`][wraps.option.Option] instead of erroring.
"""
Expand Down
4 changes: 2 additions & 2 deletions iters/sequence_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

from attrs import frozen
from typing_aliases import is_slice
from wraps.wraps import WrapOption
from wraps.wraps.option import wrap_option_on

__all__ = ("SequenceView", "sequence_view")

T = TypeVar("T")

wrap_index_error = WrapOption(IndexError)
wrap_index_error = wrap_option_on(IndexError)


@final
Expand Down
2 changes: 1 addition & 1 deletion iters/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from solus import Singleton
from typing_extensions import TypeIs
from wraps.option import NULL, Option, Some
from wraps.primitives.option import NULL, Option, Some

T = TypeVar("T")

Expand Down
4 changes: 2 additions & 2 deletions iters/wraps.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Iterable, Iterator, TypeVar

from typing_aliases import Binary, Unary
from wraps.option import NULL, Option, Some
from wraps.result import Error, Ok, Result
from wraps.primitives.option import NULL, Option, Some
from wraps.primitives.result import Error, Ok, Result

from iters.types import is_marker, marker
from iters.utils import chain
Expand Down
26 changes: 13 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "iters"
version = "0.17.0"
version = "0.18.0"
description = "Composable external iteration."
authors = ["nekitdev"]
license = "MIT"
Expand Down Expand Up @@ -31,44 +31,44 @@ include = "iters"
[tool.poetry.dependencies]
python = ">= 3.8"

typing-aliases = ">= 1.10.0"
typing-extensions = ">= 4.10.0"
typing-aliases = ">= 1.10.1"
typing-extensions = ">= 4.11.0"

named = ">= 1.4.2"
orderings = ">= 1.3.2"
orderings = ">= 1.4.0"

solus = ">= 1.2.2"

async-extensions = ">= 3.1.1"
async-extensions = ">= 4.0.0"
mixed-methods = ">= 1.1.1"

funcs = ">= 0.10.0"
wraps = ">= 0.9.2"
funcs = ">= 0.10.1"
wraps = ">= 0.11.0"

[tool.poetry.group.format.dependencies]
ruff = "0.3.3"
ruff = "0.4.1"

[tool.poetry.group.check.dependencies]
mypy = "1.9.0"

[tool.poetry.group.check.dependencies.pre-commit]
version = "3.6.2"
version = "3.7.0"
python = ">= 3.9"

[tool.poetry.group.test.dependencies]
coverage = "7.4.4"
pytest = "8.1.1"
pytest-cov = "4.1.0"
pytest-cov = "5.0.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mkdocs = "1.5.3"
mkdocs-material = "9.5.14"
mkdocs-material = "9.5.18"

[tool.poetry.group.docs.dependencies.mkdocstrings]
version = "0.24.1"
version = "0.24.3"
extras = ["python"]

[tool.poetry.group.release]
Expand Down Expand Up @@ -113,7 +113,7 @@ strict = true

[tool.changelogging]
name = "iters"
version = "0.17.0"
version = "0.18.0"
url = "https://github.com/nekitdev/iters"
directory = "changes"
output = "CHANGELOG.md"
Expand Down

0 comments on commit 07cee61

Please sign in to comment.