diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-19 15:30:20 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-19 15:30:20 -0500 |
| commit | 3e4cea6709edd16a51d513dd96da91e5aad0be66 (patch) | |
| tree | 0fa329b5b7f0f74b9e00d27772852ea7722dc2e3 /Makefile | |
| parent | 4ffa7417a359ef4eae09f61d7da4de06539462ca (diff) | |
| download | rulesets-3e4cea6709edd16a51d513dd96da91e5aad0be66.tar.gz rulesets-3e4cea6709edd16a51d513dd96da91e5aad0be66.zip | |
fix(deps): use uv tool install for playwright-py; gitignore node_modules
Two fixes rolled up:
1. Add .gitignore with **/node_modules/, package-lock.json, Python venv /
cache artifacts, and OS metadata. Prior make deps run produced a 603-
file playwright-js/node_modules tree that should never be tracked.
2. Makefile deps target: install playwright-py via `uv tool install
playwright` instead of `pip install --system`. Earlier attempts with
pip --user, pip --system, and uv pip --system all failed on externally-
managed Python (PEP 668 on Arch). `uv tool install` creates an isolated
venv for the CLI, avoiding the conflict. Chromium browsers are shared
with the JS side via ~/.cache/ms-playwright — no re-download.
Also added uv itself to the deps target (was missing).
Library import (`import playwright`) still requires per-project venv,
which is the right pattern on externally-managed systems. Deps output
mentions this explicitly.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -64,6 +64,8 @@ deps: ## Install required tools (claude, node, jq, fzf, ripgrep, emacs, playwrig { echo " ripgrep: installing..."; $(call install_pkg,ripgrep); } @command -v emacs >/dev/null 2>&1 && echo " emacs: installed" || \ { echo " emacs: installing..."; $(call install_pkg,emacs); } + @command -v uv >/dev/null 2>&1 && echo " uv: installed ($$(uv --version | awk '{print $$NF}'))" || \ + { echo " uv: installing..."; $(call install_pkg,uv); } @if [ -d "$(CURDIR)/playwright-js" ]; then \ if [ -d "$(CURDIR)/playwright-js/node_modules/playwright" ]; then \ echo " playwright (js): installed (skill node_modules present)"; \ @@ -75,13 +77,17 @@ deps: ## Install required tools (claude, node, jq, fzf, ripgrep, emacs, playwrig echo " playwright (js): skipped (playwright-js/ not present)"; \ fi @if [ -d "$(CURDIR)/playwright-py" ]; then \ - if python3 -c "import playwright" >/dev/null 2>&1; then \ - echo " playwright (py): installed (python package importable)"; \ + if command -v playwright >/dev/null 2>&1; then \ + echo " playwright (py): CLI installed ($$(playwright --version 2>&1 | head -1))"; \ + elif command -v uv >/dev/null 2>&1; then \ + echo " playwright (py): installing via uv tool (isolated venv)..."; \ + uv tool install playwright; \ + echo " (Chromium already cached by playwright-js step; no re-download.)"; \ else \ - echo " playwright (py): installing via pip --user..."; \ - python3 -m pip install --user playwright && \ - python3 -m playwright install chromium; \ - fi \ + echo " playwright (py): skipped — install uv, then re-run 'make deps'."; \ + fi; \ + echo " Per-project library import: add 'playwright' to your project's venv"; \ + echo " (e.g. 'uv add playwright' or 'pip install playwright' inside .venv)."; \ else \ echo " playwright (py): skipped (playwright-py/ not present)"; \ fi |
