Skip to content

Commit 1290142

Browse files
committed
Prepare for the next release.
1 parent 4658842 commit 1290142

23 files changed

+300
-191
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
github: [nekitdev]
2+
custom: https://nekit.dev/funding

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ updates:
2626
interval: daily
2727

2828
open-pull-requests-limit: 10
29+
30+
versioning-strategy: increase

.github/workflows/check.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,33 @@ on:
1212
jobs:
1313
check:
1414
name: Check
15+
16+
strategy:
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19+
1520
runs-on: ubuntu-latest
21+
1622
steps:
1723
- name: Checkout
1824
uses: actions/checkout@v4
1925

20-
- name: Setup Python 3.12
21-
uses: actions/setup-python@v4
26+
- name: Setup Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
2228
with:
23-
python-version: "3.12"
24-
25-
- name: Update PATH
26-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
29+
python-version: ${{ matrix.python-version }}
2730

2831
- name: Install Poetry
29-
run: curl -sSL https://install.python-poetry.org/ | python -
32+
run: pipx install poetry
3033

3134
- name: Configure Poetry
3235
run: poetry config virtualenvs.in-project true
3336

37+
- name: Specify the version
38+
run: poetry env use python
39+
3440
- name: Install dependencies
35-
run: poetry install --with check
41+
run: poetry install
3642

3743
- name: Run type checks
3844
run: poetry run mypy .

.github/workflows/docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Setup Python 3.12
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: "3.12"
2020

21-
- name: Update PATH
22-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
23-
2421
- name: Install Poetry
25-
run: curl -sSL https://install.python-poetry.org/ | python -
22+
run: pipx install poetry
2623

2724
- name: Configure Poetry
2825
run: poetry config virtualenvs.in-project true
2926

27+
- name: Specify the version
28+
run: poetry env use python
29+
3030
- name: Install dependencies
3131
run: poetry install --with docs
3232

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,27 @@ on:
88
jobs:
99
release:
1010
name: Release
11+
1112
runs-on: ubuntu-latest
13+
1214
steps:
1315
- name: Checkout
1416
uses: actions/checkout@v4
1517

1618
- name: Setup Python 3.12
17-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
1820
with:
1921
python-version: "3.12"
2022

21-
- name: Update PATH
22-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
23-
2423
- name: Install Poetry
25-
run: curl -sSL https://install.python-poetry.org/ | python -
24+
run: pipx install poetry
2625

2726
- name: Configure Poetry
2827
run: poetry config virtualenvs.in-project true
2928

29+
- name: Specify the version
30+
run: poetry env use python
31+
3032
- name: Build
3133
run: poetry build
3234

.github/workflows/test.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,33 @@ on:
1212
jobs:
1313
test:
1414
name: Test
15+
16+
strategy:
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19+
1520
runs-on: ubuntu-latest
21+
1622
steps:
1723
- name: Checkout
1824
uses: actions/checkout@v4
1925

20-
- name: Setup Python 3.12
21-
uses: actions/setup-python@v4
26+
- name: Setup Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
2228
with:
23-
python-version: "3.12"
24-
25-
- name: Update PATH
26-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
29+
python-version: ${{ matrix.python-version }}
2730

2831
- name: Install Poetry
29-
run: curl -sSL https://install.python-poetry.org/ | python -
32+
run: pipx install poetry
3033

3134
- name: Configure Poetry
3235
run: poetry config virtualenvs.in-project true
3336

37+
- name: Specify the version
38+
run: poetry env use python
39+
3440
- name: Install dependencies
35-
run: poetry install --with test
41+
run: poetry install
3642

3743
- name: Run tests
3844
run: poetry run pytest --cov-report xml

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ site/
6868
.mypy_cache/
6969
.pytype/
7070

71+
# formatters
72+
73+
.ruff_cache/
74+
7175
# cython debugging information
7276

7377
cython_debug/

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.2.2
4+
hooks:
5+
- id: ruff
6+
name: Run the Ruff linter
7+
types_or: [python, pyi]
8+
args: [--fix]
9+
- id: ruff-format
10+
name: Run the Ruff formatter
11+
types_or: [python, pyi]
12+
13+
- repo: https://github.com/python-poetry/poetry
14+
rev: 1.7.1
15+
hooks:
16+
- id: poetry-lock
17+
stages: [push]
18+
name: Run Poetry lock hook
19+
args: [--no-update]
20+
- id: poetry-check
21+
stages: [push]
22+
name: Run Poetry check hook

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ No significant changes.
8686

8787
### Changes
8888

89-
- Functions taking `Predicate[T]` have been updated to accept `Optional[Predicate[T]]`.
89+
- Functions taking `Predicate[T]` have been updated to accept `OptionalPredicate[T]`.
9090
Passing `None` as an argument is identical to passing `bool`.
9191

9292
There are three functions which do not accept `None`, though:

docs/predicates.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# Predicates
22

3-
`iters` defines all `predicate` arguments as [`Optional[Predicate[T]]`][typing.Optional]
3+
`iters` defines all `predicate` arguments as [`OptionalPredicate[T]`][iters.typing.OptionalPredicate]
44
where `T` is the item type of the iterable.
5-
6-
Passing [`None`][None] as the predicate argument is equivalent to passing [`bool`][bool],
7-
though most functions are optimized to avoid the overhead of function calls to it.

iters/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
wrap_async_iter,
2424
)
2525
from iters.iters import Iter, iter, reversed, standard_iter, standard_reversed, wrap_iter
26+
from iters.mapping_view import MappingView, mapping_view
2627
from iters.ordered_set import OrderedSet, ordered_set, ordered_set_unchecked
2728
from iters.sequence_view import SequenceView, sequence_view
2829
from iters.state import State, stateful
@@ -55,6 +56,9 @@
5556
"OrderedSet",
5657
"ordered_set",
5758
"ordered_set_unchecked",
59+
# mapping view
60+
"MappingView",
61+
"mapping_view",
5862
# sequence view
5963
"SequenceView",
6064
"sequence_view",

0 commit comments

Comments
 (0)