Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Synchronize for release #69

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Now you're ready to [run the application](#run-the-application)!
Running directly on a host requires:

- A platform of either:
- `x86_64 Linux` with `glibc>=2.35` (Ubuntu Jammy and other equivalent-generation Linux distributions)
- `x86_64 Linux` with `glibc>=2.31` (Ubuntu Focal and other equivalent-generation Linux distributions)
- `arm64 or x86_64 MacOS` with `MacOS>=13.0` and `Xcode>=14.3`
- [Rye](https://rye-up.com/) - A tool to manage `python`, `pip`, and `venv`.
- If you are already familiar with Python [virtual environments](https://docs.python.org/3/library/venv.html), feel free to use your tool of choice with [`pyproject.toml`](./pyproject.toml). Python >=3.10 is required.
Expand Down
14 changes: 11 additions & 3 deletions bank/backend/src/bank_servicer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import uuid
from bank.v1.account_rbt import Account
from bank.v1.bank_rbt import (
Bank,
Expand All @@ -20,9 +21,14 @@ async def SignUp(
state: Bank.State,
request: SignUpRequest,
) -> SignUpResponse:

# Let's go create the account, which will have a generated unique id.
account, _ = await Account.construct().Open(
# Generating an account ID so that we can demonstrate setting
# the account ID explicitly. Alternatively you can just call
# `construct()` without any args and Reboot will generate a
# unique ID for you.
new_account_id = str(uuid.uuid4())

# Let's go create the account.
account, _ = await Account.construct(id=new_account_id).Open(
context,
customer_name=request.customer_name,
)
Expand All @@ -40,6 +46,8 @@ async def Transfer(
) -> TransferResponse:
from_account = Account.lookup(request.from_account_id)
to_account = Account.lookup(request.to_account_id)

await from_account.Withdraw(context, amount=request.amount)
await to_account.Deposit(context, amount=request.amount)

return TransferResponse()
3 changes: 1 addition & 2 deletions hello-legacy-grpc/backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

async def initialize(context: ExternalContext):
# Schedule initialize on `RebootGreeter` so that it only happens
# once via idempotency (but see caveats in
# `RebootGreeterServicer.Initialize`).
# once via idempotency.
#
# NOTE: we use `schedule()` because `Initialize()` is a `workflow`
# method and those are not (yet) synchronously callable from a
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[project]
requires-python = ">= 3.10"
dependencies = [
"reboot==0.16.0",
"reboot==0.17.0",
]

[tool.rye]
dev-dependencies = [
"mypy==1.2.0",
"pytest>=7.4.2",
"types-protobuf>=4.24.0.20240129",
"reboot==0.16.0",
"reboot==0.17.0",
]

# This project only uses `rye` to provide `python` and its dependencies, so
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.2
# via kubernetes-asyncio
# via reboot
reboot==0.16.0
reboot==0.17.0
setuptools==75.1.0
# via grpcio-tools
six==1.16.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.2
# via kubernetes-asyncio
# via reboot
reboot==0.16.0
reboot==0.17.0
setuptools==75.1.0
# via grpcio-tools
six==1.16.0
Expand Down
Loading