Commit 836123b
committed
Puppeteer/Playwright: drop cache_dir entirely, inline install_root/cache
``cache_dir`` was a one-line computed helper (``install_root/cache``
when managed, ``None`` otherwise) that only existed as a convenience
alias — every callsite already branched on ``is not None``. Remove
the computed field and inline ``install_root / "cache"`` at each use:
- ``ENV`` now returns ``{}`` when ``install_root`` is None and
``{"PUPPETEER_CACHE_DIR": "<install_root>/cache"}`` /
``{"PLAYWRIGHT_BROWSERS_PATH": "<install_root>/cache"}`` otherwise.
- ``setup`` creates ``<install_root>/cache`` next to the existing
``install_root.mkdir``.
- ``_normalize_install_args`` / ``_list_installed_browsers`` pass
``--path=<install_root>/cache`` only when managed.
- ``_cleanup_partial_browser_cache`` takes an early-return when
``install_root`` is None and uses a local ``cache_dir`` var for the
glob/rmtree loop.
- Playwright ``build_exec_env`` sudo wrapper and
``default_abspath_handler`` scope check both use a local
``cache_dir`` var under ``install_root is not None``.
- Uninstall handlers already resolved the browser dir via ``load()``
in the previous commit, so they don't touch cache_dir at all.
Net result: both providers' public field surface is just
``install_root`` + ``bin_dir``, matching the "only
install_root/bin_dir" direction.1 parent 10c3759 commit 836123b
3 files changed
Lines changed: 53 additions & 80 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
1078 | 1077 | | |
1079 | 1078 | | |
1080 | 1079 | | |
1081 | | - | |
| 1080 | + | |
1082 | 1081 | | |
1083 | 1082 | | |
1084 | 1083 | | |
| |||
1097 | 1096 | | |
1098 | 1097 | | |
1099 | 1098 | | |
1100 | | - | |
1101 | 1099 | | |
1102 | 1100 | | |
1103 | 1101 | | |
1104 | 1102 | | |
1105 | | - | |
| 1103 | + | |
1106 | 1104 | | |
1107 | 1105 | | |
1108 | 1106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 80 | | |
98 | 81 | | |
99 | 82 | | |
100 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
101 | 88 | | |
102 | | - | |
| 89 | + | |
103 | 90 | | |
104 | 91 | | |
105 | 92 | | |
| |||
308 | 295 | | |
309 | 296 | | |
310 | 297 | | |
311 | | - | |
312 | | - | |
| 298 | + | |
| 299 | + | |
313 | 300 | | |
314 | 301 | | |
315 | 302 | | |
| |||
587 | 574 | | |
588 | 575 | | |
589 | 576 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
598 | 584 | | |
599 | 585 | | |
600 | 586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 70 | | |
86 | 71 | | |
87 | 72 | | |
88 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
89 | 78 | | |
90 | | - | |
| 79 | + | |
91 | 80 | | |
92 | 81 | | |
93 | 82 | | |
| |||
210 | 199 | | |
211 | 200 | | |
212 | 201 | | |
213 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
214 | 205 | | |
215 | 206 | | |
216 | 207 | | |
| |||
246 | 237 | | |
247 | 238 | | |
248 | 239 | | |
| 240 | + | |
249 | 241 | | |
250 | 242 | | |
251 | | - | |
252 | | - | |
253 | 243 | | |
254 | 244 | | |
255 | 245 | | |
| |||
300 | 290 | | |
301 | 291 | | |
302 | 292 | | |
303 | | - | |
304 | | - | |
| 293 | + | |
| 294 | + | |
305 | 295 | | |
306 | 296 | | |
307 | 297 | | |
| |||
315 | 305 | | |
316 | 306 | | |
317 | 307 | | |
318 | | - | |
319 | | - | |
| 308 | + | |
| 309 | + | |
320 | 310 | | |
321 | 311 | | |
322 | 312 | | |
| |||
448 | 438 | | |
449 | 439 | | |
450 | 440 | | |
451 | | - | |
| 441 | + | |
452 | 442 | | |
| 443 | + | |
453 | 444 | | |
454 | | - | |
| 445 | + | |
455 | 446 | | |
456 | 447 | | |
457 | 448 | | |
| |||
473 | 464 | | |
474 | 465 | | |
475 | 466 | | |
476 | | - | |
| 467 | + | |
477 | 468 | | |
478 | 469 | | |
479 | 470 | | |
| |||
551 | 542 | | |
552 | 543 | | |
553 | 544 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
574 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
575 | 564 | | |
576 | 565 | | |
577 | 566 | | |
| |||
0 commit comments