Skip to content

Commit

Permalink
Re-enable Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrattli committed Sep 28, 2024
1 parent ff3bea7 commit 268245c
Show file tree
Hide file tree
Showing 29 changed files with 401 additions and 371 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ repos:
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["[email protected].364"]
additional_dependencies: ["[email protected].382"]
repo: local
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<img src="logo/logo.jpg" alt="drawing" width="200"/>

# aioreactive - ReactiveX for asyncio using async and await

[![PyPI](https://img.shields.io/pypi/v/aioreactive.svg)](https://pypi.python.org/pypi/aioreactive)
![Python package](https://github.com/dbrattli/aioreactive/workflows/Python%20package/badge.svg)
![Publish Package](https://github.com/dbrattli/aioreactive/actions/workflows/python-publish.yml/badge.svg)
[![codecov](https://codecov.io/gh/dbrattli/aioreactive/branch/master/graph/badge.svg)](https://codecov.io/gh/dbrattli/aioreactive)


> *NEWS: Project rebooted Nov. 2020. Rebuilt using [Expression](https://github.com/dbrattli/Expression).*
Aioreactive is [RxPY](https://github.com/ReactiveX/RxPY) for asyncio.
Expand All @@ -19,9 +19,9 @@ and, integrates naturally with the Python language.
> aioreactive is the unification of RxPY and reactive programming with
> asyncio using async and await.
## The design goals for aioreactive:
## The design goals for aioreactive

* Python 3.11+ only. We have a hard dependency [Expression v5]([https://www.python.org/dev/peps/pep-0585/](https://github.com/dbrattli/Expression)).
* Python 3.10+ only. We have a hard dependency [Expression v5]([https://www.python.org/dev/peps/pep-0585/](https://github.com/dbrattli/Expression)).
* All operators and tools are implemented as plain old functions.
* Everything is `async`. Sending values is async, subscribing to
observables is async. Disposing subscriptions is async.
Expand Down
6 changes: 3 additions & 3 deletions aioreactive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Aioreactive module.
Contains the AsyncRx chained obserable that allows method chaining of all operators.
Contains the AsyncRx chained observable that allows method chaining of all operators.
Also contains all operators as plain functions.
Expand All @@ -16,11 +16,11 @@
from __future__ import annotations

from collections.abc import AsyncIterable, Awaitable, Callable, Iterable
from typing import Any, TypeVar, TypeVarTuple
from typing import Any, TypeVar

from expression import Option, curry_flip, pipe
from expression.system.disposable import AsyncDisposable
from typing_extensions import Unpack
from typing_extensions import TypeVarTuple, Unpack

from .observables import AsyncAnonymousObservable, AsyncIterableObservable
from .observers import (
Expand Down
6 changes: 3 additions & 3 deletions aioreactive/timeshift.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import logging
from collections.abc import Awaitable, Callable, Iterable
from datetime import UTC, datetime, timedelta
from datetime import datetime, timedelta, timezone
from typing import NoReturn, TypeVar

from expression import curry_flipped
Expand Down Expand Up @@ -59,7 +59,7 @@ async def loop() -> TailCallResult[None, ...]:

ns, due_time = await inbox.receive()

diff = due_time - datetime.now(UTC)
diff = due_time - datetime.now(timezone.utc)
seconds = diff.total_seconds()
if seconds > 0:
await asyncio.sleep(seconds)
Expand All @@ -84,7 +84,7 @@ async def matcher() -> None:
agent = MailboxProcessor.start(worker, token)

async def fn(ns: Notification[_TSource]) -> None:
due_time = datetime.now(UTC) + timedelta(seconds=seconds)
due_time = datetime.now(timezone.utc) + timedelta(seconds=seconds)
agent.post((ns, due_time))

obv: AsyncNotificationObserver[_TSource] = AsyncNotificationObserver(fn)
Expand Down
Loading

0 comments on commit 268245c

Please sign in to comment.