Commit bfb2d42
feat: add WSL (Windows Subsystem for Linux) detection and support
Add comprehensive WSL detection and tailored installation guidance for users
running promptfoo-python in Windows Subsystem for Linux.
Detection:
- Detects WSL via WSL_DISTRO_NAME and WSL_INTEROP environment variables
- Checks /proc/version for Microsoft/WSL signatures
- Detects WSL 1 via /mnt/c Windows filesystem mounts
- Integrated into environment detection system
Installation Guidance:
- Warns users NOT to use Windows Node.js from WSL (path/performance issues)
- Recommends installing Node.js within WSL using Linux package managers
- Provides nvm as recommended alternative for version management
- Includes WSL-specific performance tips (store files in ~/, not /mnt/c/)
- Shows both WSL guidance and Linux distro-specific instructions
Testing:
- Added 3 WSL detection tests (env vars, interop, no detection)
- Added 2 WSL instruction tests (basic, combined with Ubuntu)
- Added WSL Ubuntu environment detection test
- Updated all existing environment tests to mock WSL detection
- Total: 102 tests passing (6 new WSL-related tests)
This improves the developer experience for the large number of users who develop
in WSL, providing them with WSL-aware best practices instead of generic Linux
instructions that may lead to suboptimal configurations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 7a3d83a commit bfb2d42
5 files changed
Lines changed: 151 additions & 1 deletion
File tree
- src/promptfoo
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
174 | 201 | | |
175 | 202 | | |
176 | 203 | | |
| |||
284 | 311 | | |
285 | 312 | | |
286 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
287 | 319 | | |
288 | 320 | | |
289 | 321 | | |
| |||
302 | 334 | | |
303 | 335 | | |
304 | 336 | | |
| 337 | + | |
305 | 338 | | |
306 | 339 | | |
307 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
185 | 212 | | |
186 | 213 | | |
187 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
112 | 142 | | |
113 | 143 | | |
114 | 144 | | |
| |||
217 | 247 | | |
218 | 248 | | |
219 | 249 | | |
| 250 | + | |
220 | 251 | | |
221 | 252 | | |
222 | 253 | | |
| |||
229 | 260 | | |
230 | 261 | | |
231 | 262 | | |
| 263 | + | |
232 | 264 | | |
233 | 265 | | |
234 | 266 | | |
| |||
267 | 299 | | |
268 | 300 | | |
269 | 301 | | |
| 302 | + | |
270 | 303 | | |
271 | 304 | | |
272 | 305 | | |
| |||
285 | 318 | | |
286 | 319 | | |
287 | 320 | | |
| 321 | + | |
288 | 322 | | |
289 | 323 | | |
290 | 324 | | |
| |||
294 | 328 | | |
295 | 329 | | |
296 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
132 | 167 | | |
133 | 168 | | |
134 | 169 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments