Skip to content

1.6.0: Make Stream an AsyncIterable decorator and an Awaitable[Stream]; add all async twin operations (closes #8 #100 #101) #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
91ab8cf
1.6.0a1: Make `Stream` an `AsyncIterable` decorator and an `Awaitable…
ebonnal May 11, 2025
d1a2a04
`repr`: introduce `one_liner_max_depth=3` (closes #104)
ebonnal May 11, 2025
47b35a0
README: 'snippet'; shorter async operations section; ETL as example
ebonnal May 11, 2025
28a7946
prefer `.__next__`/`.__iter__`
ebonnal May 12, 2025
2564f92
README: shorten, merge the "`async` Operation" section into the regul…
ebonnal May 13, 2025
8d96849
README: clarify
ebonnal May 13, 2025
f7cd1b6
1.6.0a2
ebonnal May 15, 2025
a2a53b1
README: fix typo
ebonnal May 17, 2025
ddcd0c6
test_stream: remove unused import
ebonnal May 17, 2025
d9d630e
`ToStringVisitor`: replace `one_liner_max_depth` -> `max_len`
ebonnal May 17, 2025
fac8b75
replace `WrappedError` by `RuntimeError`
ebonnal May 17, 2025
ae3faf4
`_ConcurrentMap[Async]Iterable`: init `ProcessPoolExecutor` with `mp_…
ebonnal May 18, 2025
5e4bad1
functiontools: use `aiter` from `__builtins__` if available
ebonnal May 18, 2025
60cfda8
`.observe`: shorten docstring
ebonnal May 18, 2025
93fe74b
test_map_or_foreach_with_exception: check that `concurrency` is `buff…
ebonnal May 18, 2025
c2f4d58
README: change tense of ETL example's comments
ebonnal May 18, 2025
e62b793
README: update note about `async` twin operations
ebonnal May 18, 2025
5845929
`__repr__`: remove `{ClassName}(...)`
ebonnal May 18, 2025
508cacf
1.6.0a3
ebonnal May 18, 2025
7f1c5de
ci: test on 3.14.0-beta.1
ebonnal May 18, 2025
10fa2e5
`GetEventLoopMixin`: rename `_EVENT_LOOP_SINGLETON` -> `_event_loop`
ebonnal May 18, 2025
13b584d
stream: reorder methods
ebonnal May 18, 2025
4b8f97b
test_stream: reorder tests
ebonnal May 18, 2025
7800230
`.__call__`: `for` instead of `.count`
ebonnal May 18, 2025
deb5259
functiontools: replace some callable classes by function + `functools…
ebonnal May 18, 2025
d7d7a59
replace `GetEventLoopMixin` by `asynctools.get_event_loop` for sync c…
ebonnal May 19, 2025
19181c8
1.6.0a4
ebonnal May 19, 2025
1fe68c1
1.6.0a5
ebonnal May 19, 2025
2d72709
use dedicated auto-closing event loops via `EventLoopMixin`
ebonnal May 19, 2025
1b74585
`EventLoopMixin`: cancel pending tasks on deletion
ebonnal May 20, 2025
65ef82e
add `Stream.event_loop` optional attribute
ebonnal May 20, 2025
0dfb15c
rename test_map_or_foreach_concurrency -> test_map_or_foreach_concurr…
ebonnal May 20, 2025
3b7e686
`IteratorVisitor`: attach a dedicated auto-closing event loop to outp…
ebonnal May 20, 2025
806d6a1
tests.utils: remove TEST_EVENT_LOOP
ebonnal May 20, 2025
1ec0366
.gitignore: add `.venv*`/`.ruff_cache`/`.ipynb_checkpoints`
ebonnal May 20, 2025
8b94dd5
`FDFOAsyncFutureResultCollection`: base on `asyncio.Queue` to avoid r…
ebonnal May 20, 2025
ca14de3
CONTRIBUTING.md: shorten the "decorator pattern" section
ebonnal May 20, 2025
4e2babc
1.6.0a6
ebonnal May 20, 2025
75c9d30
README: mention the compatibility with PyPy
ebonnal May 20, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
- alpha
- beta
- rc
paths:
- 'version.py'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
python-version: ['3.7.17', '3.8.18', '3.9.18', '3.10.13', '3.11.7', '3.12.1', '3.13.1', '3.14.0-alpha.3']
python-version: ['3.7.17', '3.8.18', '3.9.18', '3.10.13', '3.11.7', '3.12.1', '3.13.1', '3.14.0-beta.1']

steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
__pycache__
.idea
.vscode
__pycache__
.venv
.venv*
tmp*
build
dist
streamable.egg-info
.mypy_cache
htmlcov
.ruff_cache
.coverage
streamable.egg-info
htmlcov
.ipynb_checkpoints
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ is relatively close to
Applying an operation simply performs argument validation and returns a new instance of a `Stream` sub-class corresponding to the operation. Defining a stream is basically constructing a composite structure where each node is a `Stream` instance: The above `events` variable holds a `CatchStream[int]` instance, whose `.upstream` attribute points to a `TruncateStream[int]` instance, whose `.upstream` attribute points to a `ForeachStream[int]` instance, whose `.upstream` points to a `Stream[int]` instance. Each node's `.source` attribute points to the same `range(10)`.

## Visitor Pattern
Each node in this composite structure exposes an `.accept` method enabling traversal by a visitor. Both `Stream.__iter__` and `Stream.__repr__` rely on visitor classes defined in the `streamable.visitors` package.
Each node in this composite structure exposes an `.accept` method enabling traversal by a visitor. `.__iter__`/`.__aiter__`/`.__repr__`/`.__str__`/`.__eq__` rely on visitor classes defined in the `streamable.visitors` package.

## Decorator Pattern
A `Stream[T]` both inherits from `Iterable[T]` and holds an `Iterable[T]` as its `.source`: when you instantiate a stream from an iterable you decorate it with a fluent interface.
A `Stream[T]` *decorates* an iterable with a fluent interface: it is instanciated from an `Iterable[T]`/`AsyncIterable[T]` and is an `Iterable[T]`/`AsyncIterable[T]`.
Loading