Skip to content

Commit

Permalink
refactor(core): use str_to_bool of python-strtobool instead of `s…
Browse files Browse the repository at this point in the history
…trtobool` of `distutils`
  • Loading branch information
sassanh committed Jun 25, 2024
1 parent 16e68cc commit c0f0a91
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 120 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 0.15.9

- refactor(core): use `str_to_bool` of `python-strtobool` instead of `strtobool`
of `distutils`

## Version 0.15.8

- feat(test-snapshot): the `selector` function can signal the `monitor` it should
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ store.dispatch(FinishAction())
## ⚙️ Features

- Redux API for Python developers.

- Reduce boilerplate by dropping `type` property, payload classes and action creators:

- Each action is a subclass of `BaseAction`.
Expand All @@ -152,13 +153,17 @@ store.dispatch(FinishAction())
- Its creator is its auto-generated constructor.

- Use type annotations for all its API.

- Immutable state management for predictable state updates using [python-immutable](https://github.com/sassanh/python-immutable).

- Offers a streamlined, native [API](#handling-side-effects-with-events) for handling
side-effects asynchronously, eliminating the necessity for more intricate utilities
such as redux-thunk or redux-saga.

- Incorporates the [autorun decorator](#autorun-decorator) and
the [view decorator](#view-decorator), inspired by the mobx framework, to better
integrate with elements of the software following procedural patterns.

- Supports middlewares.

## 📦 Installation
Expand Down Expand Up @@ -294,6 +299,7 @@ For a detailed example, see [features demo](/tests/test_features.py).

Contributions following Python best practices are welcome.

## 🔒 License
## 📜 License

Refer to the repository for license details.
This project is released under the Apache-2.0 License. See the [LICENSE](./LICENSE)
file for more details.
217 changes: 105 additions & 112 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "python-redux"
version = "0.15.8"
version = "0.15.9"
description = "Redux implementation for Python"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -13,6 +13,7 @@ packages = [{ include = "redux" }, { include = "redux_pytest" }]
[tool.poetry.dependencies]
python = "^3.11"
python-immutable = "^1.1.1"
python-strtobool = "^1.0.0"

[tool.poetry.group.dev]
optional = true
Expand Down
4 changes: 2 additions & 2 deletions redux/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def decorator(
store=self,
selector=selector,
comparator=comparator,
func=func,
func=cast(Callable, func),
options=options or AutorunOptions(),
)

Expand Down Expand Up @@ -381,7 +381,7 @@ def decorator(
store=self,
selector=selector,
comparator=None,
func=func,
func=cast(Callable, func),
options=AutorunOptions(
default_value=_options.default_value,
initial_call=False,
Expand Down
4 changes: 2 additions & 2 deletions redux_pytest/fixtures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .store import needs_finish, store # noqa: E402
from .wait_for import Waiter, WaitFor, wait_for # noqa: E402

__all__ = [
__all__ = (
'LoopThread',
'StoreMonitor',
'StoreSnapshot',
Expand All @@ -28,4 +28,4 @@
'store_monitor',
'store_snapshot',
'wait_for',
]
)
2 changes: 1 addition & 1 deletion redux_pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
@pytest.hookimpl
def pytest_addoption(parser: pytest.Parser) -> None:
"""Add options to the pytest command line."""
group = parser.getgroup('redux', 'python-redux')
group = parser.getgroup('redux', 'python redux options')
group.addoption('--override-store-snapshots', action='store_true')

0 comments on commit c0f0a91

Please sign in to comment.