Releases: restatedev/sdk-python
Releases · restatedev/sdk-python
v0.12.0
New features 🎉
- Added ingress client to send requests from your python applications to restate services:
async with restate.create_client("http://localhost:8080") as client:
await client.object_call(increment, key="a", arg=5)
await client.object_send(increment, key="a", arg=5)
current_count = await client.object_call(count, key="a", arg=None)- Added new test harness constructor to be used in combination with
@pytest.fixture:
# Your fixture
@pytest.fixture(scope="session")
async def restate_test_harness():
app = restate.app([greeter])
async with restate.create_test_harness(app) as harness:
yield harness
# A test example, using the client
async def test_greeter(restate_test_harness: HarnessEnvironment):
greeting = await restate_test_harness.client.service_call(greet, arg="Pippo")
assert greeting == "Hello Pippo!"- Various type hints improvements, such as #112
What's Changed
- Revert usage of asyncio cancellation mechanism by @slinkydeveloper in #142
- Update
crazy-max/ghaction-setup-dockerto v4 by @muhamadazmy in #144 - Use modern lints, tools and type checkers by @igalshilman in #143
- Add typed client by @igalshilman in #145
- Add test for harness and typed client. Fix name of TestHarnessEnvironment so it doesn't get mixed up in pytest. Fix imports in init by @slinkydeveloper in #147
Full Changelog: v0.11.0...v0.12.0
v0.11.0
New features
- You can configure more retry options for
ctx.run_typed:
ctx.run_typed("payment", payment, RunOptions(
# Initial retry interval
initial_retry_interval=timedelta(milliseconds=100),
# Retry policies are exponential, the retry interval will double on each attempt
retry_interval_factor=2.0,
# Maximum retry interval
max_retry_interval=timedelta(seconds=10),
# Max duration of retries before giving up
max_duration=timedelta(minutes=5),
# Max attempts (including the initial) before giving up
max_attempts=10,
))- You can now provide a name to
sleep, you'll be able to see this name in the UI.
Notable changes
- When suspending, the SDK will now throw an
asyncio.CancelledError, instead of the previously thrown custom error. Catch this exception only if you need to cleanup some external resources between execution attempts.
What's Changed
- Use task cancellation instead of custom suspension exception by @slinkydeveloper in #132
- Remove typing_extensions dependency by @slinkydeveloper in #133
- Copy RunOptions when mutating them by @slinkydeveloper in #135
- Add name parameter to sleep by @slinkydeveloper in #136
- Fix ctx.time() by @slinkydeveloper in #138
- Expose all run retry options by @slinkydeveloper in #137
- Test suite 3.2 upgrade by @slinkydeveloper in #139
- Use service image by @slinkydeveloper in #140
- Fix lint warning by @igalshilman in #141
Full Changelog: v0.10.1...v0.11.0
v0.10.2
Removed typing_extensions dependency.
Full Changelog: v0.10.1...v0.10.2
v0.10.1
What's Changed
- Add better closed error by @slinkydeveloper in #131
Full Changelog: v0.10.0...v0.10.1
v0.10.0
Invocation retry policy
When used with Restate 1.5, you can now configure the invocation retry policy from the SDK directly. See https://github.com/restatedev/restate/releases/tag/v1.5.0 for more details on the new invocation retry policy configuration.
What's Changed
- Retry Policy by @slinkydeveloper in #126
- Clarify ctx.run max attempts by @slinkydeveloper in #127
- Bring back Python 3.10 support by @slinkydeveloper in #129
Full Changelog: v0.9.1...v0.10.0
v0.9.1
What's Changed
- Add
always_replayflag to test harness by @slinkydeveloper in #124 - Add
disable_retriesflag to test harness by @slinkydeveloper in #125
Full Changelog: v0.9.0...v0.9.1
v0.9.0
New features ✨
ctx.random()andctx.uuid()for deterministic random and uuid. by @slinkydeveloper in #120- Add
ctx.time()as wrapper aroundctx.run(time.time)by @slinkydeveloper in #121 - Integration with standard library
loggingmodule: replay aware logging filterrestate.RestateLoggingFilterand log factoryrestate.getLogger()by @slinkydeveloper in #122
Full Changelog: v0.8.1...v0.9.0
v0.8.1
What's Changed
- enhancement: Add support for function args & kwargs type hints in ctx.run. by @objecthuman in #109
- Bump PyO3 version, this required few changes by @slinkydeveloper in #110
- Update pyproject.toml to include correct license metadata by @tillrohrmann in #111
New Contributors
- @objecthuman made their first contribution in #109
Full Changelog: v0.8.0...v0.8.1
v0.8.0
- Introduce new Service/Object/Workflow constructor fields and the decorator fields
inactivity_timeout,abort_timeout,journal_retention,idempotency_retention,ingress_private,workflow_retention. Please note these work only from Restate 1.4 onward. Check the in-code documentation for more details. - Improved error messages
What's Changed
- Discovery manifest V3 by @slinkydeveloper in #103
- Bump shared core by @slinkydeveloper in #106
- Use shared core 0.4 by @slinkydeveloper in #107
New Contributors
- @muhamadazmy made their first contribution in #101
Full Changelog: v0.7.3...v0.8.0