effecton 0.2.0__tar.gz → 0.3.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 (41) hide show
  1. {effecton-0.2.0 → effecton-0.3.0}/.gitignore +8 -0
  2. effecton-0.3.0/CHANGELOG.md +47 -0
  3. effecton-0.3.0/PKG-INFO +714 -0
  4. effecton-0.3.0/README.md +696 -0
  5. effecton-0.3.0/conftest.py +1 -0
  6. {effecton-0.2.0 → effecton-0.3.0}/pyproject.toml +10 -1
  7. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/__init__.py +39 -0
  8. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/attempt.py +1 -1
  9. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/effect.py +71 -4
  10. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/exit.py +9 -3
  11. effecton-0.3.0/src/effecton/pytest_plugin.py +75 -0
  12. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/run_async.py +55 -4
  13. effecton-0.3.0/src/effecton/run_main.py +97 -0
  14. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/run_sync.py +24 -9
  15. effecton-0.3.0/src/effecton/std/clock.py +143 -0
  16. effecton-0.3.0/src/effecton/std/duration.py +32 -0
  17. effecton-0.3.0/src/effecton/std/fiber.py +93 -0
  18. effecton-0.3.0/src/effecton/std/file_system.py +816 -0
  19. effecton-0.3.0/src/effecton/std/http_client.py +372 -0
  20. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/std/logger.py +3 -1
  21. effecton-0.3.0/src/effecton/std/path.py +68 -0
  22. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/std/pretty_logger.py +15 -4
  23. effecton-0.3.0/src/effecton/std/process.py +57 -0
  24. effecton-0.3.0/src/effecton/std/race.py +16 -0
  25. effecton-0.3.0/src/effecton/std/random.py +119 -0
  26. effecton-0.3.0/src/effecton/std/retry.py +54 -0
  27. effecton-0.3.0/src/effecton/std/schedule.py +79 -0
  28. effecton-0.3.0/src/effecton/std/timeout.py +67 -0
  29. effecton-0.3.0/src/effecton/std/tracer.py +289 -0
  30. effecton-0.2.0/CHANGELOG.md +0 -19
  31. effecton-0.2.0/PKG-INFO +0 -389
  32. effecton-0.2.0/README.md +0 -373
  33. {effecton-0.2.0 → effecton-0.3.0}/LICENSE +0 -0
  34. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/catch.py +0 -0
  35. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/gen.py +0 -0
  36. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/implicit_requirement.py +0 -0
  37. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/provide.py +0 -0
  38. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/py.typed +0 -0
  39. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/std/__init__.py +0 -0
  40. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/std/scope.py +0 -0
  41. {effecton-0.2.0 → effecton-0.3.0}/src/effecton/suspend.py +0 -0
@@ -11,3 +11,11 @@ wheels/
11
11
 
12
12
  # Copied from the repo root by the release workflow
13
13
  packages/effecton/LICENSE
14
+
15
+ # Docs site (vocs)
16
+ docs/node_modules
17
+ docs/dist
18
+ docs/.vocs
19
+ docs/src/pages.gen.ts
20
+ # Generated by `uv run api-reference` (docs predev/prebuild)
21
+ docs/src/pages/api.md
@@ -0,0 +1,47 @@
1
+ # effecton
2
+
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Launch the docs site: a landing page, an introduction, and a generated API Reference, with every Python snippet type-checked by ty at build time. ([#26](https://github.com/krzkaczor/effecton/pull/26))
8
+
9
+ ### Patch Changes
10
+
11
+ - Add the E.HttpClient service: SyncLive and AsyncLive on httpx2, Test with canned responses or a handler, Request/Response values and filter_status_ok; HTTP client libraries are banned outside the service ([#24](https://github.com/krzkaczor/effecton/pull/24))
12
+ - sleep, timeout and Schedule.spaced/exponential accept a duration as timedelta's keyword parts (seconds=5, minutes=1, ...) in place of a timedelta. ([#26](https://github.com/krzkaczor/effecton/pull/26))
13
+ - Add the `E.Tracer` service: `E.with_span(effect, name, kind=..., **attributes)` opens a span around an effect (also as `effect.with_span`), `E.annotate_current_span` adds attributes, `E.current_span` reads the open span, `E.Tracer.Live` is the in-memory default, `E.Tracer.Test` records its spans, and the `test_tracer` pytest fixture provides one ([#25](https://github.com/krzkaczor/effecton/pull/25))
14
+ - Add `effect.retry(schedule, until=...)` with `E.Schedule.recurs`, `E.Schedule.spaced`, and `E.Schedule.exponential` ([#19](https://github.com/krzkaczor/effecton/pull/19))
15
+ - Effect.retry takes an optional schedule and a `times` keyword, as in Effect-TS: `retry(times=3)` retries up to three times without waiting, `retry(schedule, times=5)` caps the schedule at five more recurrences, and `retry()` with neither recurs forever. ([#26](https://github.com/krzkaczor/effecton/pull/26))
16
+ - Add `schedule.jittered(min=0.8, max=1.2)`, which scales every delay by a factor drawn through `E.random()`; schedule steps are now effects, so build a plain custom schedule with `E.Schedule.from_delays(...)` and an effectful one with `E.Schedule(steps=...)` ([#22](https://github.com/krzkaczor/effecton/pull/22))
17
+ - Add the `E.FileSystem` service (`SyncLive`, `AsyncLive` on aiofiles, in-memory `Test`) the immutable `E.Path`, and the `E.Process` service (`cwd`, `home`); stdlib path and file APIs are banned outside the service ([#23](https://github.com/krzkaczor/effecton/pull/23))
18
+ - `on_exit` also accepts a function receiving the effect's `Exit` and returning the finalizer, so cleanup can depend on how the effect settled ([#25](https://github.com/krzkaczor/effecton/pull/25))
19
+ - Add the `E.Random` implicit service: `E.random()` resolves it, its methods keep the `random` module names (`random`, `uniform`, `randint`, `choice`, `shuffle`), `E.Random.Live` is the default, `E.Random.Test(seed)` is deterministic, and the `test_random` pytest fixture provides one seeded with 0 ([#22](https://github.com/krzkaczor/effecton/pull/22))
20
+
21
+ ## 0.2.1
22
+
23
+ ### Patch Changes
24
+
25
+ - Ship a pytest plugin, registered through the pytest11 entry point so it loads wherever effecton is installed. A test that returns an Effect (typically an @E.gen function) runs under the async runner and a failure is reported as its cause. The test_clock fixture provides an E.Clock.Test to the test's effect. ([#16](https://github.com/krzkaczor/effecton/pull/16))
26
+ - Add E.now() and E.sleep() backed by the implicit E.Clock service, with SyncLive, AsyncLive and Test clocks; each runner installs the matching live clock. ([#16](https://github.com/krzkaczor/effecton/pull/16))
27
+ - Add `E.run_main` to execute sync and async programs with failure logging, defect tracebacks, custom exit codes, and graceful signal handling. ([#14](https://github.com/krzkaczor/effecton/pull/14))
28
+ - Add E.fork, E.Fiber (join, wait, poll, interrupt) and E.yield_now backed by asyncio tasks, and make the Test clock's adjust and set_time return effects. ([#16](https://github.com/krzkaczor/effecton/pull/16))
29
+ - Add E.race_first(left, right) and E.timeout(duration) ([#18](https://github.com/krzkaczor/effecton/pull/18))
30
+
31
+ ## 0.2.0
32
+
33
+ ### Minor Changes
34
+
35
+ - Add `run_async`, `coroutine` and `attempt_async` for awaitable-backed effects ([#12](https://github.com/krzkaczor/effecton/pull/12))
36
+ - Split the runners: `run_sync` and `run_async` now return the value and raise on failure (the error, the defect, or `UnhandledDefect` for a non-exception defect); `run_sync_exit`, `run_async_exit` and the coroutine `run_async_coroutine` return the `Exit` ([#13](https://github.com/krzkaczor/effecton/pull/13))
37
+
38
+ ### Patch Changes
39
+
40
+ - Add `Effect.catch`: handle one error type and subtract it from the error channel. ([#10](https://github.com/krzkaczor/effecton/pull/10))
41
+ - Add `Interrupt` as a third `Cause` state, produced when a cancellation unwinds `run_async` ([#12](https://github.com/krzkaczor/effecton/pull/12))
42
+
43
+ ## 0.1.1
44
+
45
+ ### Patch Changes
46
+
47
+ - Migrate from mypy to ty. Simplify api where possible. ([#1](https://github.com/krzkaczor/effecton/pull/1))