Skip to content

Commit

Permalink
Merge pull request #32 from mdapena/v0.7.0-prep
Browse files Browse the repository at this point in the history
Prepare for Pyventus `v0.7.0` Release
  • Loading branch information
mdapena authored Jan 7, 2025
2 parents 8ec5eb1 + b7ebf63 commit a2ed1b8
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 19 deletions.
6 changes: 2 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ authors:
repository-code: 'https://github.com/mdapena/pyventus'
url: 'https://mdapena.github.io/pyventus/'
abstract: >-
A modern and robust Python package for event-driven
programming. Define, emit, and orchestrate events with
ease using customizable event emitters and flexible
responses.
A powerful Python library for event-driven and
reactive programming.
keywords:
- events
- event-emitter
Expand Down
2 changes: 1 addition & 1 deletion docs/.overrides/announce.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<b><a href="{{ base_url ~ '/release-notes/#0.7.0'}}">Pyventus v0.7</a> is now live!</b>
🚀 <b><a href="{{ base_url ~ '/release-notes/#0.7.0'}}">Pyventus v0.7</a> is now live!</b>
Don't miss the <b>latest updates</b>,
featuring <b><a href="{{ base_url ~ '/#a-simple-reactive-example'}}">reactive programming</a></b>,
major <b><a href="{{ base_url ~ '/release-notes/#0.7.0-optimized'}}">optimizations</a></b>, and more!
Expand Down
4 changes: 2 additions & 2 deletions docs/learn/upgrade_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ Please review the following breaking changes and apply the necessary actions to
- [ ] The `EventLinker` has experienced some method renames and return type modifications to align with the new redesigned codebase:
- [ ] `remove_event_handler()``remove_subscriber()`.
- [ ] `get_event_handlers()``get_subscribers()`: Now returns a `set` instead of a `list`.
- [ ] `get_events_by_event_handler()``get_events_from_subscribers()`: Now returns a `set` instead of a `list` and includes a new flag `pop_onetime_subscribers`.
- [ ] `get_events_by_event_handler()``get_events_from_subscribers()`: Now returns a `set` instead of a `list` and supports retrieving events for multiple subscribers.
- [ ] `get_event_handlers_by_events()``get_subscribers_from_events()`: Now returns a `set` instead of a `list` and includes a new flag `pop_onetime_subscribers`.
- [ ] `unsubscribe()``remove()`: Now removes one event from a subscriber at a time.
- [ ] Parameters named `event_handler` have been renamed to `subscriber` in all methods.
- [ ] `get_events()`: Now returns a `set` instead of a `list` with non-duplicates.
- [ ] The `RQEventEmitter` has been renamed to `RedisEventEmitter`.
- [ ] The `CeleryEventEmitter.Queue` has been removed, and the `CeleryEventEmitter` now requires a `Celery` instance. Security aspects have been delegated to the `Celery` app.
- [ ] Dependency injection for the `FastAPIEventEmitter` through FastAPI's `Depends()` function has been simplified; use `Depends(FastAPIEventEmitter())` for all scenarios.
- [ ] The `ExecutorEventEmitter` can no longer be used as a context manager; for this purpose, use the new `ExecutorEventEmitterCtx`.
- [ ] The `CeleryEventEmitter.Queue` has been removed, and the `CeleryEventEmitter` now requires a `Celery` instance. Security aspects have been delegated to the `Celery` app configuration.

## Questions and Issues

Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hide:

[//]: # "--------------------------------------------------------------------------------------------------------------"

## [v0.7.0](https://github.com/mdapena/pyventus/releases/tag/0.7.0) <small>Unreleased</small> { id="0.7.0" }
## [v0.7.0](https://github.com/mdapena/pyventus/releases/tag/0.7.0) <small>January 7, 2025</small> { id="0.7.0" }

<hr class="divider">

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repo_url: https://github.com/mdapena/pyventus

# Copyright
copyright: |
Copyright &copy; 2023-2024 <a href="https://github.com/mdapena" target="_blank" rel="mdapena">Manuel Da Pena</a>
Copyright &copy; 2023-2025 <a href="https://github.com/mdapena" target="_blank" rel="mdapena">Manuel Da Pena</a>
# Configuration
theme:
Expand Down
23 changes: 18 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,26 @@ readme = "README.md"
license = "MIT"
authors = [{ name = "Manuel Da Pena", email = "[email protected]" }]
keywords = [
"event",
"events",
"event-emitters",
"event-dispatchers",
"event-handlers",
"event-linkers",
"event driven",
"event-driven",
"python",
"event driven programming",
"event-driven programming",
"EventEmitter",
"event emitter",
"event emitters",
"reactive",
"reactive programming",
"reactive-programming",
"observer pattern",
"observable",
"observables",
"observer",
"observers",
"asynchronous",
"asynchronous programming",
"asynchronous-programming",
]
classifiers = [
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion src/pyventus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A powerful Python library for event-driven and reactive programming."""

__version__ = "0.6.0"
__version__ = "0.7.0"

from .core.exceptions import PyventusException, PyventusImportException

Expand Down
24 changes: 20 additions & 4 deletions tests/pyventus/reactive/subscribers/test_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,35 @@ class TestSubscriber:
# Test Cases for creation
# =================================

def test_creation_with_valid_input(self) -> None:
@pytest.mark.parametrize(
["next_callback", "error_callback", "complete_callback"],
[
(CallableMock.Sync(), None, None),
(None, CallableMock.Async(), None),
(None, None, CallableMock.Async()),
(CallableMock.Async(), None, CallableMock.Sync()),
(CallableMock.Async(), CallableMock.Sync(), None),
(None, CallableMock.Sync(), CallableMock.Async()),
],
)
def test_creation_with_valid_input(
self, next_callback: CallableMock.Base, error_callback: CallableMock.Base, complete_callback: CallableMock.Base
) -> None:
# Arrange/Act
subscriber = Subscriber[Any](
teardown_callback=lambda sub: True,
next_callback=lambda val: None,
error_callback=None,
complete_callback=None,
next_callback=next_callback,
error_callback=error_callback,
complete_callback=complete_callback,
force_async=False,
)

# Assert
assert subscriber is not None
assert isinstance(subscriber, Subscriber)
assert subscriber.has_next_callback is bool(next_callback is not None)
assert subscriber.has_error_callback is bool(error_callback is not None)
assert subscriber.has_complete_callback is bool(complete_callback is not None)

# =================================

Expand Down

0 comments on commit a2ed1b8

Please sign in to comment.