streamable 2.1.0b0__tar.gz → 2.1.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {streamable-2.1.0b0 → streamable-2.1.0b1}/PKG-INFO +6 -5
  2. {streamable-2.1.0b0 → streamable-2.1.0b1}/README.md +4 -4
  3. {streamable-2.1.0b0 → streamable-2.1.0b1}/pyproject.toml +1 -0
  4. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/__init__.py +3 -3
  5. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_afunctions.py +5 -8
  6. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_aiterators.py +373 -251
  7. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_functions.py +8 -9
  8. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_iterators.py +137 -127
  9. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_stream.py +67 -32
  10. streamable-2.1.0b1/streamable/_tools/_afuture.py +100 -0
  11. streamable-2.1.0b1/streamable/_tools/_async.py +14 -0
  12. streamable-2.1.0b1/streamable/_tools/_context.py +69 -0
  13. streamable-2.1.0b1/streamable/_tools/_error.py +26 -0
  14. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_func.py +4 -4
  15. streamable-2.1.0b1/streamable/_tools/_future.py +100 -0
  16. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_iter.py +40 -17
  17. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_observation.py +1 -0
  18. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_sentinel.py +0 -1
  19. streamable-2.1.0b1/streamable/_tools/_star.py +65 -0
  20. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_aiter.py +10 -8
  21. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_eq.py +25 -39
  22. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_iter.py +2 -3
  23. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/PKG-INFO +6 -5
  24. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/SOURCES.txt +1 -1
  25. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/requires.txt +1 -0
  26. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_buffer.py +10 -4
  27. streamable-2.1.0b1/tests/test_closing.py +829 -0
  28. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_do.py +2 -0
  29. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_eq.py +5 -0
  30. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_flatten.py +5 -6
  31. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_group.py +78 -16
  32. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_map.py +29 -4
  33. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_observe.py +89 -2
  34. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_other.py +217 -11
  35. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_readme.py +6 -7
  36. streamable-2.1.0b1/tests/test_ref_cycles.py +199 -0
  37. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_repr.py +3 -4
  38. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_tools.py +13 -5
  39. streamable-2.1.0b0/streamable/_tools/_afuture.py +0 -81
  40. streamable-2.1.0b0/streamable/_tools/_async.py +0 -20
  41. streamable-2.1.0b0/streamable/_tools/_context.py +0 -32
  42. streamable-2.1.0b0/streamable/_tools/_error.py +0 -42
  43. streamable-2.1.0b0/streamable/_tools/_future.py +0 -75
  44. streamable-2.1.0b0/streamable/_tools/_star.py +0 -82
  45. streamable-2.1.0b0/tests/test_aclose.py +0 -245
  46. streamable-2.1.0b0/tests/test_ref_cycles.py +0 -85
  47. {streamable-2.1.0b0 → streamable-2.1.0b1}/LICENSE +0 -0
  48. {streamable-2.1.0b0 → streamable-2.1.0b1}/setup.cfg +0 -0
  49. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/__init__.py +0 -0
  50. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_logging.py +0 -0
  51. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/_tools/_validation.py +1 -1
  52. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/py.typed +0 -0
  53. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/__init__.py +0 -0
  54. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_base.py +2 -2
  55. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_involves_async.py +2 -2
  56. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable/visitors/_repr.py +3 -3
  57. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/dependency_links.txt +0 -0
  58. {streamable-2.1.0b0 → streamable-2.1.0b1}/streamable.egg-info/top_level.txt +0 -0
  59. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_catch.py +1 -1
  60. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_filter.py +0 -0
  61. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_skip.py +0 -0
  62. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_take.py +0 -0
  63. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_throttle.py +1 -1
  64. {streamable-2.1.0b0 → streamable-2.1.0b1}/tests/test_visitor.py +2 -2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamable
3
- Version: 2.1.0b0
3
+ Version: 2.1.0b1
4
4
  Summary: sync/async iterable streams for Python
5
5
  Author-email: ebonnal <bonnal.enzo.dev@gmail.com>
6
6
  License: Apache 2.
@@ -13,6 +13,7 @@ Requires-Dist: httpx==0.28.1; python_version >= "3.9" and extra == "dev"
13
13
  Requires-Dist: mypy==1.18.2; python_version >= "3.9" and extra == "dev"
14
14
  Requires-Dist: mypy-extensions==1.0.0; python_version >= "3.9" and extra == "dev"
15
15
  Requires-Dist: polars==1.36.1; python_version >= "3.9" and extra == "dev"
16
+ Requires-Dist: pyright==1.1.414; python_version >= "3.9" and extra == "dev"
16
17
  Requires-Dist: pytest==7.4.4; python_version >= "3.9" and extra == "dev"
17
18
  Requires-Dist: pytest-asyncio==0.21.2; python_version >= "3.9" and extra == "dev"
18
19
  Requires-Dist: pytest-cov==7.0.0; python_version >= "3.9" and extra == "dev"
@@ -42,7 +43,7 @@ Dynamic: license-file
42
43
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-3820/)
43
44
  [![PyPI version](https://img.shields.io/pypi/v/streamable.svg)](https://pypi.org/project/streamable/)
44
45
  [![Anaconda-Server Badge](https://anaconda.org/conda-forge/streamable/badges/version.svg)](https://anaconda.org/conda-forge/streamable)
45
- [![coverage](https://codecov.io/gh/ebonnal/streamable/graph/badge.svg?token=S62T0JQK9N)](https://codecov.io/gh/ebonnal/streamable)
46
+ [![branch coverage](https://img.shields.io/codecov/c/github/ebonnal/streamable?label=branch%20coverage)](https://codecov.io/gh/ebonnal/streamable)
46
47
  [![readthedocs](https://app.readthedocs.org/projects/streamable/badge/?version=latest&style=social)](https://streamable.readthedocs.io/en/latest/api.html)
47
48
 
48
49
 
@@ -128,7 +129,7 @@ A `stream` can be iterated several times if its source allows it.
128
129
 
129
130
  Operations return a new `stream`.
130
131
 
131
- Operations allow iteration to resume after an exception.
132
+ Operations allow iteration to resume after an `Exception`.
132
133
 
133
134
  Operations accept both sync and async functions.
134
135
 
@@ -594,9 +595,9 @@ During an async iteration, these operations spawn child tasks:
594
595
 
595
596
  When the iteration is complete, all the child tasks are done.
596
597
 
597
- When the iterator is destroyed before it is exhausted, the pending child tasks are cancelled at a subsequent cycle of the event loop.
598
+ When the iterator is destroyed before it is exhausted, the pending child tasks terminate at a subsequent cycle of the event loop.
598
599
 
599
- `stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly cancel any pending child tasks:
600
+ `stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly terminate any pending child tasks:
600
601
 
601
602
  ```python
602
603
  from contextlib import aclosing
@@ -7,7 +7,7 @@
7
7
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-3820/)
8
8
  [![PyPI version](https://img.shields.io/pypi/v/streamable.svg)](https://pypi.org/project/streamable/)
9
9
  [![Anaconda-Server Badge](https://anaconda.org/conda-forge/streamable/badges/version.svg)](https://anaconda.org/conda-forge/streamable)
10
- [![coverage](https://codecov.io/gh/ebonnal/streamable/graph/badge.svg?token=S62T0JQK9N)](https://codecov.io/gh/ebonnal/streamable)
10
+ [![branch coverage](https://img.shields.io/codecov/c/github/ebonnal/streamable?label=branch%20coverage)](https://codecov.io/gh/ebonnal/streamable)
11
11
  [![readthedocs](https://app.readthedocs.org/projects/streamable/badge/?version=latest&style=social)](https://streamable.readthedocs.io/en/latest/api.html)
12
12
 
13
13
 
@@ -93,7 +93,7 @@ A `stream` can be iterated several times if its source allows it.
93
93
 
94
94
  Operations return a new `stream`.
95
95
 
96
- Operations allow iteration to resume after an exception.
96
+ Operations allow iteration to resume after an `Exception`.
97
97
 
98
98
  Operations accept both sync and async functions.
99
99
 
@@ -559,9 +559,9 @@ During an async iteration, these operations spawn child tasks:
559
559
 
560
560
  When the iteration is complete, all the child tasks are done.
561
561
 
562
- When the iterator is destroyed before it is exhausted, the pending child tasks are cancelled at a subsequent cycle of the event loop.
562
+ When the iterator is destroyed before it is exhausted, the pending child tasks terminate at a subsequent cycle of the event loop.
563
563
 
564
- `stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly cancel any pending child tasks:
564
+ `stream.__aiter__` returns an async iterator with an `.aclose` method to eagerly terminate any pending child tasks:
565
565
 
566
566
  ```python
567
567
  from contextlib import aclosing
@@ -19,6 +19,7 @@ dev = [
19
19
  "mypy==1.18.2; python_version >= '3.9'",
20
20
  "mypy-extensions==1.0.0; python_version >= '3.9'",
21
21
  "polars==1.36.1; python_version >= '3.9'",
22
+ "pyright==1.1.414; python_version >= '3.9'",
22
23
  "pytest==7.4.4; python_version >= '3.9'",
23
24
  "pytest-asyncio==0.21.2; python_version >= '3.9'",
24
25
  "pytest-cov==7.0.0; python_version >= '3.9'",
@@ -1,7 +1,7 @@
1
1
  from streamable._stream import stream
2
- from streamable._tools._star import star
3
- from streamable._tools._observation import Observation
4
2
  from streamable._tools._iter import ClosableAsyncIterator
3
+ from streamable._tools._observation import Observation
4
+ from streamable._tools._star import star
5
5
 
6
6
  Stream = stream
7
7
 
@@ -12,4 +12,4 @@ ClosableAsyncIterator.__module__ = __name__
12
12
 
13
13
  __all__ = ["stream", "star", "Observation", "ClosableAsyncIterator"]
14
14
 
15
- __version__ = "2.1.0b0"
15
+ __version__ = "2.1.0b1"
@@ -1,5 +1,5 @@
1
- from concurrent.futures import Executor
2
1
  import datetime
2
+ from concurrent.futures import Executor
3
3
  from inspect import iscoroutinefunction
4
4
  from operator import itemgetter
5
5
  from typing import (
@@ -15,12 +15,11 @@ from typing import (
15
15
  cast,
16
16
  )
17
17
 
18
- from streamable._tools._iter import ClosableAsyncIterator
19
- from streamable._tools._observation import Observation
20
-
21
18
  from streamable import _aiterators
22
19
  from streamable._tools._async import AsyncFunction
23
20
  from streamable._tools._func import asyncify
21
+ from streamable._tools._iter import ClosableAsyncIterator
22
+ from streamable._tools._observation import Observation
24
23
 
25
24
  T = TypeVar("T")
26
25
  U = TypeVar("U")
@@ -84,9 +83,7 @@ def group(
84
83
  if by is None:
85
84
  return _aiterators.GroupAsyncIterator(upstream, up_to=up_to)
86
85
  return _aiterators.FlattenAsyncIterator(
87
- _aiterators.GroupByAsyncIterator(
88
- upstream, by=cast(AsyncFunction[T, U], asyncify(by)), up_to=up_to
89
- )
86
+ _aiterators.GroupByAsyncIterator(upstream, by=asyncify(by), up_to=up_to)
90
87
  )
91
88
  if by is None:
92
89
  return _aiterators.MapAsyncIterator(
@@ -115,7 +112,7 @@ def map(
115
112
  if iscoroutinefunction(into):
116
113
  return _aiterators.AsyncConcurrentMapAsyncIterator(
117
114
  upstream,
118
- cast(AsyncFunction[T, U], into),
115
+ into,
119
116
  concurrency=cast(int, concurrency),
120
117
  as_completed=as_completed,
121
118
  )