Skip to content

Commit

Permalink
Prepare for the next release.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekitdev committed Feb 25, 2024
1 parent 4658842 commit 1290142
Show file tree
Hide file tree
Showing 23 changed files with 300 additions and 191 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: [nekitdev]
custom: https://nekit.dev/funding
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ updates:
interval: daily

open-pull-requests-limit: 10

versioning-strategy: increase
22 changes: 14 additions & 8 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,33 @@ on:
jobs:
check:
name: Check

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.12
uses: actions/setup-python@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
run: pipx install poetry

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

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with check
run: poetry install

- name: Run type checks
run: poetry run mypy .
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
uses: actions/checkout@v4

- name: Setup Python 3.12
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
run: pipx install poetry

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

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with docs

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ on:
jobs:
release:
name: Release

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.12
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
run: pipx install poetry

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

- name: Specify the version
run: poetry env use python

- name: Build
run: poetry build

Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,33 @@ on:
jobs:
test:
name: Test

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.12
uses: actions/setup-python@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
run: pipx install poetry

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

- name: Specify the version
run: poetry env use python

- name: Install dependencies
run: poetry install --with test
run: poetry install

- name: Run tests
run: poetry run pytest --cov-report xml
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ site/
.mypy_cache/
.pytype/

# formatters

.ruff_cache/

# cython debugging information

cython_debug/
Expand Down
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
name: Run the Ruff linter
types_or: [python, pyi]
args: [--fix]
- id: ruff-format
name: Run the Ruff formatter
types_or: [python, pyi]

- repo: https://github.com/python-poetry/poetry
rev: 1.7.1
hooks:
- id: poetry-lock
stages: [push]
name: Run Poetry lock hook
args: [--no-update]
- id: poetry-check
stages: [push]
name: Run Poetry check hook
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ No significant changes.

### Changes

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

There are three functions which do not accept `None`, though:
Expand Down
5 changes: 1 addition & 4 deletions docs/predicates.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Predicates

`iters` defines all `predicate` arguments as [`Optional[Predicate[T]]`][typing.Optional]
`iters` defines all `predicate` arguments as [`OptionalPredicate[T]`][iters.typing.OptionalPredicate]
where `T` is the item type of the iterable.

Passing [`None`][None] as the predicate argument is equivalent to passing [`bool`][bool],
though most functions are optimized to avoid the overhead of function calls to it.
4 changes: 4 additions & 0 deletions iters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
wrap_async_iter,
)
from iters.iters import Iter, iter, reversed, standard_iter, standard_reversed, wrap_iter
from iters.mapping_view import MappingView, mapping_view
from iters.ordered_set import OrderedSet, ordered_set, ordered_set_unchecked
from iters.sequence_view import SequenceView, sequence_view
from iters.state import State, stateful
Expand Down Expand Up @@ -55,6 +56,9 @@
"OrderedSet",
"ordered_set",
"ordered_set_unchecked",
# mapping view
"MappingView",
"mapping_view",
# sequence view
"SequenceView",
"sequence_view",
Expand Down
Loading

0 comments on commit 1290142

Please sign in to comment.