From 3e4cea6709edd16a51d513dd96da91e5aad0be66 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 19 Apr 2026 15:30:20 -0500 Subject: fix(deps): use uv tool install for playwright-py; gitignore node_modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .gitignore | 14 ++++++++++++++ Makefile | 18 ++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b985e99 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Node artifacts +**/node_modules/ +**/package-lock.json + +# Python artifacts +**/__pycache__/ +**/*.pyc +**/.venv/ +**/.pytest_cache/ + +# OS / editor +.DS_Store +*.swp +*~ diff --git a/Makefile b/Makefile index 74d1905..a7ad7da 100644 --- a/Makefile +++ b/Makefile @@ -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 -- cgit v1.2.3