From 7bfae7d322df46a0f71709cabf2fa6cd3a21af87 Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Wed, 5 Jun 2024 17:32:04 +0200 Subject: [PATCH] Add webserver example --- examples/webserver/.gitignore | 3 ++ examples/webserver/README.md | 13 ++++++++ .../my-webserver-0.1.0-pyh4616a5c_0.conda | Bin 0 -> 6485 bytes examples/webserver/my_webserver/__init__.py | 8 +++++ examples/webserver/pixi.toml | 21 ++++++++++++ examples/webserver/pyproject.toml | 16 +++++++++ examples/webserver/recipe/recipe.yaml | 31 ++++++++++++++++++ 7 files changed, 92 insertions(+) create mode 100644 examples/webserver/.gitignore create mode 100644 examples/webserver/README.md create mode 100644 examples/webserver/my-webserver-0.1.0-pyh4616a5c_0.conda create mode 100644 examples/webserver/my_webserver/__init__.py create mode 100644 examples/webserver/pixi.toml create mode 100644 examples/webserver/pyproject.toml create mode 100644 examples/webserver/recipe/recipe.yaml diff --git a/examples/webserver/.gitignore b/examples/webserver/.gitignore new file mode 100644 index 0000000..21db2b6 --- /dev/null +++ b/examples/webserver/.gitignore @@ -0,0 +1,3 @@ +.pixi/ +output/ +__pycache__/ diff --git a/examples/webserver/README.md b/examples/webserver/README.md new file mode 100644 index 0000000..d0ca8c1 --- /dev/null +++ b/examples/webserver/README.md @@ -0,0 +1,13 @@ +# Webserver + +This is a simple web server that runs FastAPI. + +## Run the server + +```bash +rattler-build build -r recipe/recipe.yaml +pixi-pack pack -e prod --platform win-64 --inject output/noarch/my-webserver-*.conda +``` + +> [!NOTE] +> The file `my-webserver-0.1.0-pyh4616a5c_0.conda` is only for testing, in a real scenario it would be in the `output/noarch` directory generated by `rattler-build`. diff --git a/examples/webserver/my-webserver-0.1.0-pyh4616a5c_0.conda b/examples/webserver/my-webserver-0.1.0-pyh4616a5c_0.conda new file mode 100644 index 0000000000000000000000000000000000000000..d790735979809059b5a55980f1eee2e2b190ad1f GIT binary patch literal 6485 zcmb7pRa6vg+w}l5lrW@2NH;iih=}A29U~1YFoX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12 + - fastapi + +tests: + - python: + imports: + - my_webserver + - package_contents: + site_packages: + - my_webserver/__init__.py