From c006585d3c90ed72838ee660498a30314395199c Mon Sep 17 00:00:00 2001 From: pyranota Date: Tue, 16 Dec 2025 10:38:07 +0100 Subject: [PATCH] fix Signed-off-by: pyranota --- .../14_dependencies_in_typescript/index.mdx | 6 ++ .../15_dependencies_in_python/index.mdx | 68 +++---------------- 2 files changed, 14 insertions(+), 60 deletions(-) diff --git a/docs/advanced/14_dependencies_in_typescript/index.mdx b/docs/advanced/14_dependencies_in_typescript/index.mdx index fdf8b1f43..e3c7ebcd3 100644 --- a/docs/advanced/14_dependencies_in_typescript/index.mdx +++ b/docs/advanced/14_dependencies_in_typescript/index.mdx @@ -8,6 +8,7 @@ Both of these runtimes allow you to include dependencies directly in the script, There are however methods to have more control on your dependencies: +- Using [workspace dependencies](../../core_concepts/55_workspace_dependencies/index.mdx) for centralized dependency management at the workspace level. - Leveraging [standard mode](#lockfile-per-script-inferred-from-imports-standard) on [web IDE](#web-ide) or [locally](#cli). - Overriding dependencies [providing a package.json](#lockfile-per-script-inferred-from-a-packagejson). - [Bundling](#bundle-per-script-built-by-cli) per script with CLI, more powerful and local only. @@ -22,6 +23,11 @@ To learn more about how dependencies from other languages are handled, see [Depe ![Dependency management & imports](../6_imports/dependency_management.png 'Dependency management & imports')
+ + @@ -88,63 +93,6 @@ When a lockfile is present alongside a script at time of deployment by the CLI, description="Develop locally, push to git and deploy automatically to Windmill." href="/docs/advanced/local_development" /> -
- -## Lockfile per script inferred from a requirements.txt - -Although Windmill can [automatically resolve imports](#lockfile-per-script-inferred-from-imports-standard). It is possible to override the dependencies by providing a `requirements.txt` file in the same directory as the script as you would do in a standard Python project, building and maintaining a requirements.txt to declare dependencies. - - - -
- -When doing [`wmill script generate-metadata`](../3_cli/script.md#re-generating-a-script-metadata-file), if a requirements.txt is discovered, the closest one will be used as source-of-truth instead of being discovered from the imports in the script directly to generate the lockfile from the server. - -You can write those requirements.txt manually or through a standard `pip install package_name`. - -Several requirements.txt files can therefore coexist, each having authority over the scripts closest to it: - -``` -└── windmill_folder/ - ├── requirements.txt - ├── f/foo/ - │ ├── requirements.txt - │ ├── script1.py - │ ├── # script1.py will use the dependencies from windmill_folder/f/foo/requirements.txt - │ └── /bar/ - │ ├── requirements.txt - │ ├── script2.py - │ └── # script2.py will use the dependencies from windmill_folder/f/foo/bar/requirements.txt - └── f/baz/ - ├── script3.py - └── # script3.py will use the dependencies from windmill_folder/requirements.txt -``` - -The Windmill [VS Code extension](../../cli_local_dev/1_vscode-extension/index.mdx) has a toggle "Infer lockfile" / "Use current lockfile". - -With this toggle, you can choose to use the metadata lockfile (derived from requirements.txt after `wmill script generate-metadata`) instead of inferring them directly from the script. - -![Toggle Lockfile](../../cli_local_dev/1_vscode-extension/toggle_lockfile.png 'Toggle Lockfile') - -
- -