From f2c91a0ddfa1e97895ed8121f3d48496d1d1c214 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Mon, 14 Jul 2025 14:08:06 +0200 Subject: [PATCH] cleanup: python/hello: no more feature flag for host builder --- python/hello/README.md | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/python/hello/README.md b/python/hello/README.md index 0b6aeab..f9fc9a0 100644 --- a/python/hello/README.md +++ b/python/hello/README.md @@ -2,26 +2,20 @@ ## Introduction -A Python HTTP function built with ASGI protocol support. The implementation -provides a simple HTTP endpoint that responds with "Hello World!" to incoming +A Python HTTP function built with ASGI protocol support. The implementation +provides a simple HTTP endpoint that responds with "Hello World!" to incoming requests. The function is structured as a class-based implementation with proper lifecycle management, including configurable startup and shutdown hooks. -## Recommended Deployment +## Deployment > [!NOTE] -> We recommend using the host builder. -> This feature is currently behind a flag because its not available for all the -> languages yet so you will need to enable it. +> We recommend using the host builder ```bash -# Enable the host builder -export FUNC_ENABLE_HOST_BUILDER=1 - # Deploy your code to cluster -# Make sure to set the builder to use it func deploy --builder=host # Local development and testing @@ -42,7 +36,7 @@ The function provides lifecycle hooks: ## Testing -The function includes unit tests that verify the HTTP handler behavior. +The function includes unit tests that verify the HTTP handler behavior. Tests are located in the `tests/` directory and use pytest with asyncio support. To run the tests: @@ -60,14 +54,14 @@ pytest -v ### Test Structure -Tests are organized in the `tests/` directory with the current test file +Tests are organized in the `tests/` directory with the current test file `test_func.py` verifying that the ASGI handler returns a proper 200 OK response. The testing framework uses pytest with asyncio support, configured in `pyproject.toml`. ### Writing New Tests -To add new tests, create files named `test_*.py` in the `tests/` directory. -For async functions, use the `@pytest.mark.asyncio` decorator. Mock ASGI -components by creating mock `scope`, `receive`, and `send` functions as shown -in the existing test. You can also test lifecycle methods like `start()`, +To add new tests, create files named `test_*.py` in the `tests/` directory. +For async functions, use the `@pytest.mark.asyncio` decorator. Mock ASGI +components by creating mock `scope`, `receive`, and `send` functions as shown +in the existing test. You can also test lifecycle methods like `start()`, `stop()`, `alive()`, and `ready()` by calling them directly on a function instance.