diff --git a/README.md b/README.md index a3f4ec7..c83152d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/bank/backend/src/bank_servicer.py b/bank/backend/src/bank_servicer.py index 71ba5cb..baed81c 100644 --- a/bank/backend/src/bank_servicer.py +++ b/bank/backend/src/bank_servicer.py @@ -1,4 +1,5 @@ import logging +import uuid from bank.v1.account_rbt import Account from bank.v1.bank_rbt import ( Bank, @@ -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, ) @@ -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() diff --git a/hello-legacy-grpc/backend/src/main.py b/hello-legacy-grpc/backend/src/main.py index 7f8b1e7..9f897f6 100755 --- a/hello-legacy-grpc/backend/src/main.py +++ b/hello-legacy-grpc/backend/src/main.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 85cd0d7..7c1bae8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] requires-python = ">= 3.10" dependencies = [ - "reboot==0.16.0", + "reboot==0.17.0", ] [tool.rye] @@ -9,7 +9,7 @@ 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 diff --git a/requirements-dev.lock b/requirements-dev.lock index 505929c..7681cad 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -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 diff --git a/requirements.lock b/requirements.lock index 0a3f214..7f55a03 100644 --- a/requirements.lock +++ b/requirements.lock @@ -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