From 4129e0222e08278b95ac3cb147ef63fafbf5f303 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Fri, 6 Dec 2024 11:24:30 -0500 Subject: [PATCH] Parameterize fastapi-github example with environment vars (#3078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📝 Summary Detects `GITHUB_REPO` and `REPO_ROOT` environment variables if set, falling back to default in marimo. (I believe this is the desired behavior of the script) ## 🔍 Description of Changes Just detects `GITHUB_REPO` and `REPO_ROOT` environment variables if set. ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [ ] I have added tests for the changes made. - [ ] I have run the code and verified that it works as expected. ## 📜 Reviewers @mscolnick --- examples/frameworks/fastapi-github/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/frameworks/fastapi-github/main.py b/examples/frameworks/fastapi-github/main.py index 12b9f8d5307..72c1a8383fa 100644 --- a/examples/frameworks/fastapi-github/main.py +++ b/examples/frameworks/fastapi-github/main.py @@ -23,8 +23,8 @@ logger = logging.getLogger(__name__) # Constants -GITHUB_REPO = "marimo-team/marimo" -ROOT_DIR = "examples/ui" +GITHUB_REPO = os.environ.get("GITHUB_REPO", "marimo-team/marimo") +ROOT_DIR = os.environ.get("ROOT_DIR", "examples/ui") templates_dir = os.path.join(os.path.dirname(__file__), "templates") # Set up templates