You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ See [Preparing Environments](guides/preparing-environments.md) for a full explan
133
133
|`--dev-env=<env>`| Override the detected dev environment. One of: `ai`, `ci`, `cli`, `ide`, `precommit` (default: auto-detected) |
134
134
135
135
136
-
!!! note `--env-names` restricts only the final `prepare_handler_envs` step. The `create_envs`and `prepare_runner_envs` steps still run for **all** envs regardless of this flag — envs and runners must exist for every env even when you only need to update dependencies in one of them.
136
+
!!! note `--env-names` restricts only the `install_envs` step. The `create_envs`step still runs for **all** envs regardless of this flag — virtualenvs must exist for every env even when you only need to update dependencies in one of them.
Copy file name to clipboardExpand all lines: docs/guides/preparing-environments.md
+31-26Lines changed: 31 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
FineCode runs handlers in purpose-specific virtual environments. Handlers that share the same `env` name (e.g. `dev_no_runtime`) run in the same virtualenv. Before handlers can execute, their environments must exist and contain the right dependencies. This guide explains how that process works and how to control it.
4
4
5
-
## The three-step sequence
5
+
## The two-step sequence
6
6
7
-
Environment preparation is split into three distinct actions that must run in order:
7
+
Environment preparation is split into two distinct actions that must run in order:
Installs the **Extension Runner** (`finecode_extension_runner`) into each virtualenv. This is what lets FineCode start runners that can actually load handler code.
30
+
Installs the full dependency set into each virtualenv. This reads the `dependency-groups` entries and calls `install_deps_in_env` for each env, including `finecode_extension_runner` and all handler tool dependencies (e.g. ruff, mypy).
31
31
32
-
Preset packages are only installed in `dev_workspace` (handled during the bootstrap phase — see below). Only the runner is installed into other envs here — not the full handler dependency trees.
32
+
After this step every handler has all its dependencies available and can execute.
33
33
34
-
!!! note
35
-
`prepare_runner_envs` must run **after** `create_envs` and **before** runners are started. Runners are started automatically between steps 2and 3 by the WM during `prepare-envs`.
34
+
---
36
35
37
-
### Step 3 — `prepare_handler_envs`
36
+
## The `dev_workspace` bootstrap
38
37
39
-
Installs the full dependency set for each handler into its declared `env` virtualenv. This reads the `dependency-groups` entries and calls `install_deps_in_env` for each env.
38
+
The `dev_workspace` env is special: it contains FineCode itself and the preset packages. The handlers that implement `create_envs` and `install_envs` live inside `dev_workspace` — which creates a bootstrapping constraint.
40
39
41
-
After this step every handler has all its dependencies available and can execute.
40
+
### Workspace root bootstrap (manual, one-time)
42
41
43
-
---
42
+
The workspace root's `dev_workspace` is the **seed** for everything. `prepare-envs` cannot run unless FineCode is already installed somewhere, so the workspace root's `dev_workspace` must be created manually on a fresh checkout:
This is the only step that cannot be automated by FineCode itself. See [Getting Started](../getting-started.md) for the full first-time setup sequence.
44
51
45
-
## The `dev_workspace` bootstrap env
52
+
### Subproject bootstrap (automated by `prepare-envs`)
46
53
47
-
The `dev_workspace` env is special: it contains FineCode itself and the preset packages. This means the handlers that implement `prepare_runner_envs` and `prepare_handler_envs` *live inside* `dev_workspace`.
54
+
For subprojects in the workspace, `prepare-envs` creates their `dev_workspace` envs automatically — **before** starting any runners — using the workspace root's handler configuration:
48
55
49
-
Because of this, `prepare-envs` handles `dev_workspace` separately, **before** starting runners:
56
+
1. `create_envs` (subproject `dev_workspace` envs) — create the venvs
**Requirement:** the workspace root's `create_envs` and `install_envs` configuration must produce a valid `dev_workspace` for every subproject. In practice this is rarely a constraint: `dev_workspace` envs exist only to run FineCode and preset packages, so their setup is uniform across projects. If a subproject genuinely requires different handler configuration for either action, its `dev_workspace` must be bootstrapped manually the same way as the workspace root's.
53
60
54
-
Only after this bootstrap are runners started, and only then can the remaining steps run across all envs.
61
+
Only after all `dev_workspace` envs exist are runners started, and only then can the remaining steps run across all envs.
Restricts the `prepare_handler_envs` step (step 3) to the named environments. The `create_envs` and `prepare_runner_envs` steps still run for **all** envs regardless of this flag.
105
+
Restricts the `install_envs` step (step 2) to the named environments. The `create_envs` step still runs for **all** envs regardless of this flag.
100
106
101
-
**Why?** Virtualenvs and runners must exist for every env — they are cheap to create and skip if already valid. Filtering at those steps would leave envs in a broken state if they don't exist yet.
107
+
**Why?** Virtualenvs must exist for every env — they are cheap to create and skip if already valid. Filtering at that step would leave envs in a broken state if they don't exist yet.
102
108
103
109
Useful when you've added a new handler in one env and want to update only that env without reinstalling everything.
104
110
105
111
---
106
112
107
113
## Calling actions directly
108
114
109
-
The three actions (`create_envs`, `prepare_runner_envs`, `prepare_handler_envs`) are standard FineCode actions and can be invoked individually via the WM API or `python -m finecode run`. This is useful when writing custom orchestration.
115
+
The two actions (`create_envs`, `install_envs`) are standard FineCode actions and can be invoked individually via the WM API or `python -m finecode run`. This is useful when writing custom orchestration.
0 commit comments