python-redux 0.16.0__tar.gz → 0.17.0__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 (20) hide show
  1. {python_redux-0.16.0 → python_redux-0.17.0}/PKG-INFO +3 -1
  2. {python_redux-0.16.0 → python_redux-0.17.0}/pyproject.toml +4 -2
  3. {python_redux-0.16.0 → python_redux-0.17.0}/redux/autorun.py +1 -6
  4. {python_redux-0.16.0 → python_redux-0.17.0}/redux/basic_types.py +0 -1
  5. {python_redux-0.16.0 → python_redux-0.17.0}/redux/main.py +0 -1
  6. {python_redux-0.16.0 → python_redux-0.17.0}/redux/serialization_mixin.py +1 -1
  7. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/fixtures/event_loop.py +1 -1
  8. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/fixtures/monitor.py +1 -1
  9. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/fixtures/snapshot.py +2 -2
  10. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/fixtures/store.py +3 -3
  11. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/fixtures/wait_for.py +1 -1
  12. {python_redux-0.16.0 → python_redux-0.17.0}/LICENSE +0 -0
  13. {python_redux-0.16.0 → python_redux-0.17.0}/README.md +0 -0
  14. {python_redux-0.16.0 → python_redux-0.17.0}/redux/__init__.py +0 -0
  15. {python_redux-0.16.0 → python_redux-0.17.0}/redux/combine_reducers.py +0 -0
  16. {python_redux-0.16.0 → python_redux-0.17.0}/redux/py.typed +0 -0
  17. {python_redux-0.16.0 → python_redux-0.17.0}/redux/side_effect_runner.py +0 -0
  18. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/__init__.py +0 -0
  19. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/fixtures/__init__.py +0 -0
  20. {python_redux-0.16.0 → python_redux-0.17.0}/redux_pytest/plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-redux
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: Redux implementation for Python
5
5
  Home-page: https://github.com/sassanh/python-redux/
6
6
  License: Apache-2.0
@@ -12,8 +12,10 @@ Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Dist: pyright (>=1.1.378,<2.0.0)
15
16
  Requires-Dist: python-immutable (>=1.1.1,<2.0.0)
16
17
  Requires-Dist: python-strtobool (>=1.0.0,<2.0.0)
18
+ Requires-Dist: ruff (>=0.6.3,<0.7.0)
17
19
  Project-URL: Repository, https://github.com/sassanh/python-redux/
18
20
  Description-Content-Type: text/markdown
19
21
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-redux"
3
- version = "0.16.0"
3
+ version = "0.17.0"
4
4
  description = "Redux implementation for Python"
5
5
  authors = ["Sassan Haradji <sassanh@gmail.com>"]
6
6
  license = "Apache-2.0"
@@ -14,6 +14,8 @@ packages = [{ include = "redux" }, { include = "redux_pytest" }]
14
14
  python = "^3.11"
15
15
  python-immutable = "^1.1.1"
16
16
  python-strtobool = "^1.0.0"
17
+ pyright = "^1.1.378"
18
+ ruff = "^0.6.3"
17
19
 
18
20
  [tool.poetry.group.dev]
19
21
  optional = true
@@ -21,7 +23,7 @@ optional = true
21
23
  [tool.poetry.group.dev.dependencies]
22
24
  poethepoet = "^0.24.4"
23
25
  pyright = "^1.1.376"
24
- ruff = "^0.5.7"
26
+ ruff = "^0.6.0"
25
27
  pytest = "^8.1.1"
26
28
  pytest-cov = "^4.1.0"
27
29
  pytest-timeout = "^2.3.1"
@@ -45,9 +45,6 @@ class Autorun(
45
45
  ],
46
46
  options: AutorunOptions[AutorunOriginalReturnType],
47
47
  ) -> None:
48
- if not options.reactive and options.auto_call:
49
- msg = '`reactive` must be `True` if `auto_call` is `True`'
50
- raise ValueError(msg)
51
48
  self._store = store
52
49
  self._selector = selector
53
50
  self._comparator = comparator
@@ -80,9 +77,7 @@ class Autorun(
80
77
 
81
78
  if self._options.reactive:
82
79
  self._unsubscribe = store.subscribe(
83
- lambda state: self._call()
84
- if self._check(state) and self._options.auto_call
85
- else None,
80
+ lambda state: self._call() if self._check(state) else None,
86
81
  )
87
82
  else:
88
83
  self._unsubscribe = None
@@ -134,7 +134,6 @@ class CreateStoreOptions(Immutable, Generic[Action, Event]):
134
134
  class AutorunOptions(Immutable, Generic[AutorunOriginalReturnType]):
135
135
  default_value: AutorunOriginalReturnType | None = None
136
136
  initial_call: bool = True
137
- auto_call: bool = True
138
137
  reactive: bool = True
139
138
  keep_ref: bool = True
140
139
  subscribers_initial_run: bool = True
@@ -389,7 +389,6 @@ class Store(Generic[State, Action, Event], SerializationMixin):
389
389
  options=AutorunOptions(
390
390
  default_value=_options.default_value,
391
391
  initial_call=False,
392
- auto_call=False,
393
392
  reactive=False,
394
393
  keep_ref=_options.keep_ref,
395
394
  subscribers_initial_run=_options.subscribers_initial_run,
@@ -37,7 +37,7 @@ class SerializationMixin:
37
37
  cls: type[SerializationMixin],
38
38
  obj: Immutable,
39
39
  ) -> dict[str, Any]:
40
- result = {}
40
+ result: dict[str, object] = {'_type': obj.__class__.__name__}
41
41
  for field in dataclasses.fields(obj):
42
42
  value = cls.serialize_value(getattr(obj, field.name))
43
43
  result[field.name] = value
@@ -25,7 +25,7 @@ class LoopThread(threading.Thread):
25
25
  self.loop.call_soon_threadsafe(self.loop.create_task, coro)
26
26
 
27
27
 
28
- @pytest.fixture()
28
+ @pytest.fixture
29
29
  def event_loop() -> LoopThread:
30
30
  loop_thread = LoopThread()
31
31
  loop_thread.start()
@@ -39,7 +39,7 @@ class StoreMonitor:
39
39
  self.store.register_event_middleware(self._event_middleware)
40
40
 
41
41
 
42
- @pytest.fixture()
42
+ @pytest.fixture
43
43
  def store_monitor(store: Store, mocker: MockerFixture) -> StoreMonitor:
44
44
  """Fixture to check if an action was dispatched."""
45
45
  monitor = StoreMonitor(mocker)
@@ -145,13 +145,13 @@ class StoreSnapshot(Generic[State]):
145
145
  assert not json_path.exists(), f'Snapshot {filename} not taken'
146
146
 
147
147
 
148
- @pytest.fixture()
148
+ @pytest.fixture
149
149
  def snapshot_prefix() -> str | None:
150
150
  """Return the prefix for the snapshots."""
151
151
  return None
152
152
 
153
153
 
154
- @pytest.fixture()
154
+ @pytest.fixture
155
155
  def store_snapshot(
156
156
  request: SubRequest,
157
157
  store: Store,
@@ -10,14 +10,14 @@ if TYPE_CHECKING:
10
10
  from redux.main import Store
11
11
 
12
12
 
13
- @pytest.fixture()
14
- def store() -> Store: # noqa: PT004 # pragma: no cover
13
+ @pytest.fixture
14
+ def store() -> Store: # pragma: no cover
15
15
  """Provide current store (this is a placeholder returning None)."""
16
16
  msg = 'This fixture should be overridden.'
17
17
  raise NotImplementedError(msg)
18
18
 
19
19
 
20
- @pytest.fixture()
20
+ @pytest.fixture
21
21
  def needs_finish(store: Store) -> Generator:
22
22
  """Dispatch a finish action after the test."""
23
23
  yield None
@@ -157,7 +157,7 @@ class WaitFor:
157
157
  return decorator(check) if check else decorator
158
158
 
159
159
 
160
- @pytest.fixture()
160
+ @pytest.fixture
161
161
  def wait_for() -> Generator[WaitFor, None, None]:
162
162
  """Provide `wait_for` decorator."""
163
163
  context = WaitFor()
File without changes
File without changes