From e6904177a7122ab51efa793cfca52dacbb3cd385 Mon Sep 17 00:00:00 2001 From: kyosuke Date: Thu, 4 Jun 2026 21:38:44 +0900 Subject: [PATCH] Document system-packages for inline scripts --- docs/how-to/run/python-scripts.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/how-to/run/python-scripts.md b/docs/how-to/run/python-scripts.md index 888e113da..bb40aa627 100644 --- a/docs/how-to/run/python-scripts.md +++ b/docs/how-to/run/python-scripts.md @@ -66,3 +66,13 @@ You may use the `[tool.hatch]` table directly to control the script's [environme # installer = "pip" # /// ``` + +You can also give the script's environment access to the system site-packages (the equivalent of a virtual environment created with `--system-site-packages`) by setting `system-packages`: + +```python tab="script.py" +# /// script +# ... +# [tool.hatch] +# system-packages = true +# /// +```