Skip to content

Commit 28dd52c

Browse files
dbrattliMainRo
andauthored
Fix build (#729)
* Fix build by pining pyyaml to 5.3.1 see yaml/pyyaml#724 for the origin of the error. We can remove this once pyyaml 7.0 is released. * Fix unit tests * Upgrade pip in code-quality ci job * Upgrade pip in code-quality ci job * Bump pre-commit checks * Update actions cache * Update pyyaml to and Python deps * Fix typing issues * Python 3.7 deprecated --------- Co-authored-by: Romain Picard <[email protected]>
1 parent 2ae9fa4 commit 28dd52c

36 files changed

+764
-789
lines changed

.github/workflows/python-package.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: |
25+
pip install --upgrade pip
2526
pip install poetry
2627
poetry install
2728
@@ -73,7 +74,7 @@ jobs:
7374
python-version: "3.12"
7475

7576
- name: Cache Poetry
76-
uses: actions/cache@v2
77+
uses: actions/cache@v4
7778
with:
7879
path: |
7980
~/.cache/pypoetry

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,33 @@ repos:
44
- --remove-all-unused-imports
55
- --in-place
66
id: autoflake
7-
repo: https://github.com/humitos/mirrors-autoflake
8-
rev: v1.1
7+
repo: https://github.com/PyCQA/autoflake
8+
rev: v2.3.1
99
- hooks:
1010
- id: isort
1111
repo: https://github.com/timothycrosley/isort
12-
rev: 5.10.1
12+
rev: 5.13.2
1313
- hooks:
1414
- id: black
1515
repo: https://github.com/psf/black
16-
rev: 22.3.0
16+
rev: 24.10.0
1717
- hooks:
1818
- id: flake8
1919
exclude: (^docs/|^examples/|^notebooks/|^tests/)
2020
repo: https://github.com/PyCQA/flake8
21-
rev: 3.9.2
21+
rev: 7.1.1
2222
- hooks:
2323
- id: pyright
2424
name: pyright
2525
entry: pyright
2626
language: node
2727
pass_filenames: false
2828
types: [python]
29-
additional_dependencies: ["[email protected].286"]
29+
additional_dependencies: ["[email protected].388"]
3030
repo: local
3131
- hooks:
3232
- id: mypy
3333
exclude: (^docs/|^examples/|^notebooks/|^tests/|^reactivex/operators/_\w.*\.py$)
3434
repo: https://github.com/pre-commit/mirrors-mypy
35-
rev: v0.942
35+
rev: v1.13.0
3636

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ReactiveX for Python v4
2828
For v3.X please go to the `v3 branch
2929
<https://github.com/ReactiveX/RxPY/tree/release/v3.2.x>`_.
3030

31-
ReactiveX for Python v4.x runs on `Python <http://www.python.org/>`_ 3.7 or above. To
31+
ReactiveX for Python v4.x runs on `Python <http://www.python.org/>`_ 3.8 or above. To
3232
install:
3333

3434
.. code:: console

examples/autocomplete/bottle_autocomplete.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Requires besides bottle and gevent also the geventwebsocket pip package
44
- Instead of a future we create the inner stream for flat_map_latest manually
55
"""
6+
67
import json
78

89
import gevent

poetry.lock

Lines changed: 544 additions & 536 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ classifiers = [
1515
"License :: OSI Approved :: MIT License",
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python :: 3",
18-
"Programming Language :: Python :: 3.7",
1918
"Programming Language :: Python :: 3.8",
2019
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
@@ -28,10 +27,11 @@ packages = [
2827
]
2928

3029
[tool.poetry.dependencies]
31-
python = ">= 3.7, < 4.0"
30+
python = ">= 3.8, < 4.0"
3231
typing-extensions = "^4.1.1"
3332

34-
[tool.poetry.dev-dependencies]
33+
[tool.poetry.group.test.dependencies]
34+
pyyaml = "6.0.2"
3535
pytest-asyncio = "^0.18.1"
3636
pytest = "^7.0.1"
3737
coverage = "^6.3.2"
@@ -75,4 +75,3 @@ asyncio_mode = "strict"
7575
[build-system]
7676
requires = ["poetry-core>=1.0.0"]
7777
build-backend = "poetry.core.masonry.api"
78-

reactivex/__init__.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -185,22 +185,19 @@ def create(subscribe: typing.Subscription[_T]) -> Observable[_T]:
185185
@overload
186186
def combine_latest(
187187
__a: Observable[_A], __b: Observable[_B]
188-
) -> Observable[Tuple[_A, _B]]:
189-
...
188+
) -> Observable[Tuple[_A, _B]]: ...
190189

191190

192191
@overload
193192
def combine_latest(
194193
__a: Observable[_A], __b: Observable[_B], __c: Observable[_C]
195-
) -> Observable[Tuple[_A, _B, _C]]:
196-
...
194+
) -> Observable[Tuple[_A, _B, _C]]: ...
197195

198196

199197
@overload
200198
def combine_latest(
201199
__a: Observable[_A], __b: Observable[_B], __c: Observable[_C], __d: Observable[_D]
202-
) -> Observable[Tuple[_A, _B, _C, _D]]:
203-
...
200+
) -> Observable[Tuple[_A, _B, _C, _D]]: ...
204201

205202

206203
def combine_latest(*__sources: Observable[Any]) -> Observable[Any]:
@@ -289,7 +286,7 @@ def concat_with_iterable(sources: Iterable[Observable[_T]]) -> Observable[_T]:
289286

290287

291288
def defer(
292-
factory: Callable[[abc.SchedulerBase], Union[Observable[_T], "Future[_T]"]]
289+
factory: Callable[[abc.SchedulerBase], Union[Observable[_T], "Future[_T]"]],
293290
) -> Observable[_T]:
294291
"""Returns an observable sequence that invokes the specified
295292
factory function whenever a new observer subscribes.
@@ -382,22 +379,21 @@ def for_in(
382379

383380

384381
@overload
385-
def fork_join(__a: Observable[_A], __b: Observable[_B]) -> Observable[Tuple[_A, _B]]:
386-
...
382+
def fork_join(
383+
__a: Observable[_A], __b: Observable[_B]
384+
) -> Observable[Tuple[_A, _B]]: ...
387385

388386

389387
@overload
390388
def fork_join(
391389
__a: Observable[_A], __b: Observable[_B], __c: Observable[_C]
392-
) -> Observable[Tuple[_A, _B, _C]]:
393-
...
390+
) -> Observable[Tuple[_A, _B, _C]]: ...
394391

395392

396393
@overload
397394
def fork_join(
398395
__a: Observable[_A], __b: Observable[_B], __c: Observable[_C], __d: Observable[_D]
399-
) -> Observable[Tuple[_A, _B, _C, _D]]:
400-
...
396+
) -> Observable[Tuple[_A, _B, _C, _D]]: ...
401397

402398

403399
@overload
@@ -407,8 +403,7 @@ def fork_join(
407403
__c: Observable[_C],
408404
__d: Observable[_D],
409405
__e: Observable[_E],
410-
) -> Observable[Tuple[_A, _B, _C, _D, _E]]:
411-
...
406+
) -> Observable[Tuple[_A, _B, _C, _D, _E]]: ...
412407

413408

414409
def fork_join(*sources: Observable[Any]) -> Observable[Any]:
@@ -920,7 +915,7 @@ def of(*args: _T) -> Observable[_T]:
920915
def on_error_resume_next(
921916
*sources: Union[
922917
Observable[_T], "Future[_T]", Callable[[Optional[Exception]], Observable[_T]]
923-
]
918+
],
924919
) -> Observable[_T]:
925920
"""Continues an observable sequence that is terminated normally or
926921
by an exception with the next observable sequence.
@@ -1213,8 +1208,8 @@ def to_async(
12131208

12141209

12151210
def using(
1216-
resource_factory: Callable[[], abc.DisposableBase],
1217-
observable_factory: Callable[[abc.DisposableBase], Observable[_T]],
1211+
resource_factory: Callable[[], Optional[abc.DisposableBase]],
1212+
observable_factory: Callable[[Optional[abc.DisposableBase]], Observable[_T]],
12181213
) -> Observable[_T]:
12191214
"""Constructs an observable sequence that depends on a resource
12201215
object, whose lifetime is tied to the resulting observable

reactivex/disposable/multipleassignmentdisposable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def set_disposable(self, value: DisposableBase) -> None:
2828
if not should_dispose:
2929
self.current = value
3030

31-
if should_dispose and value is not None:
31+
if should_dispose:
3232
value.dispose()
3333

3434
disposable = property(get_disposable, set_disposable)

reactivex/disposable/serialdisposable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def set_disposable(self, value: abc.DisposableBase) -> None:
3737
if old is not None:
3838
old.dispose()
3939

40-
if should_dispose and value is not None:
40+
if should_dispose:
4141
value.dispose()
4242

4343
disposable = property(get_disposable, set_disposable)

reactivex/internal/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def alias(name: str, doc: str, fun: Callable[_P, _T]) -> Callable[_P, _T]:
4141
args = (_fun.__code__, _fun.__globals__)
4242
kwargs = {"name": name, "argdefs": _fun.__defaults__, "closure": _fun.__closure__}
4343
alias_ = FunctionType(*args, **kwargs) # type: ignore
44-
alias_ = update_wrapper(alias_, _fun)
45-
alias_.__kwdefaults__ = _fun.__kwdefaults__
44+
alias_ = update_wrapper(alias_, _fun) # type: ignore
45+
alias_.__kwdefaults__ = _fun.__kwdefaults__ # type: ignore
4646
alias_.__doc__ = doc
4747
alias_.__annotations__ = _fun.__annotations__
4848
return cast(Callable[_P, _T], alias_)

0 commit comments

Comments
 (0)